From fe09d8c03ec8d895dd8eaa1bbdad52875996b1aa Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 30 Sep 2025 00:17:17 +0200 Subject: [PATCH] add docstring --- src/globals/functions.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/globals/functions.php b/src/globals/functions.php index c8c40b68..8127548b 100644 --- a/src/globals/functions.php +++ b/src/globals/functions.php @@ -245,6 +245,13 @@ function clean_spaces(string $string): string return trim(preg_replace('/\s+/', ' ', $string)); } +/** + * Deduplicate flags in a string. + * + * @param string $flags The string containing flags to deduplicate. Only the last occurence of each flag will be kept. + * E.g. `-lintl -lstdc++ -lphp -lstdc++` becomes `-lintl -lphp -lstdc++` + * @return string the deduplicated string with no duplicate flags + */ function deduplicate_flags(string $flags): string { $tokens = preg_split('/\s+/', trim($flags));