mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 03:51:37 +00:00
Clean up
This commit is contained in:
@@ -130,8 +130,8 @@ final class CommandOverload{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Parameter[]
|
||||
* @phpstan-return list<Parameter>
|
||||
* @return Parameter[]|string[]
|
||||
* @phpstan-return list<Parameter<*>|string>
|
||||
*/
|
||||
public function getParameters() : array{ return $this->parameters; }
|
||||
|
||||
|
@@ -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){
|
||||
|
Reference in New Issue
Block a user