mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add docstring
This commit is contained in:
parent
c2813d5736
commit
fe09d8c03e
@ -245,6 +245,13 @@ function clean_spaces(string $string): string
|
|||||||
return trim(preg_replace('/\s+/', ' ', $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
|
function deduplicate_flags(string $flags): string
|
||||||
{
|
{
|
||||||
$tokens = preg_split('/\s+/', trim($flags));
|
$tokens = preg_split('/\s+/', trim($flags));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user