From 371b991692027f521ef9d8e4c2ee695cf04a42b1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 12 Oct 2025 19:04:04 +0100 Subject: [PATCH] Clean up --- src/command/overload/CommandOverload.php | 4 ++-- src/command/utils/CommandStringHelper.php | 11 ----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/command/overload/CommandOverload.php b/src/command/overload/CommandOverload.php index c0064e90b..cd20a8b7a 100644 --- a/src/command/overload/CommandOverload.php +++ b/src/command/overload/CommandOverload.php @@ -130,8 +130,8 @@ final class CommandOverload{ } /** - * @return Parameter[] - * @phpstan-return list + * @return Parameter[]|string[] + * @phpstan-return list|string> */ public function getParameters() : array{ return $this->parameters; } diff --git a/src/command/utils/CommandStringHelper.php b/src/command/utils/CommandStringHelper.php index 8c7194d2c..009f7689d 100644 --- a/src/command/utils/CommandStringHelper.php +++ b/src/command/utils/CommandStringHelper.php @@ -63,17 +63,6 @@ final class CommandStringHelper{ return $args; } - /** - * Splits by the same logic as {@link self::parseQuoteAware()}, but doesn't strip quotes from the parts or remove - * escapes. Useful if you need to join the parts back into a new command string. - * - * @return string[] - */ - public static function splitQuoteAware(string $commandLine) : array{ - preg_match_all('/"((?:\\\\.|[^\\\\"])*)"|(\S+)/u', $commandLine, $matches); - return $matches[0]; - } - public static function parseQuoteAwareSingle(string $commandLine, int &$offset = 0) : ?string{ //quoted or bare string, like the old CommandStringHelper if(preg_match('/\G(?:"((?:\\\\.|[^\\\\"])*)"|(\S+))/u', $commandLine, $matches, offset: $offset) > 0){