mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +00:00
Clean up
This commit is contained in:
@@ -130,8 +130,8 @@ final class CommandOverload{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Parameter[]
|
* @return Parameter[]|string[]
|
||||||
* @phpstan-return list<Parameter>
|
* @phpstan-return list<Parameter<*>|string>
|
||||||
*/
|
*/
|
||||||
public function getParameters() : array{ return $this->parameters; }
|
public function getParameters() : array{ return $this->parameters; }
|
||||||
|
|
||||||
|
@@ -63,17 +63,6 @@ final class CommandStringHelper{
|
|||||||
return $args;
|
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{
|
public static function parseQuoteAwareSingle(string $commandLine, int &$offset = 0) : ?string{
|
||||||
//quoted or bare string, like the old CommandStringHelper
|
//quoted or bare string, like the old CommandStringHelper
|
||||||
if(preg_match('/\G(?:"((?:\\\\.|[^\\\\"])*)"|(\S+))/u', $commandLine, $matches, offset: $offset) > 0){
|
if(preg_match('/\G(?:"((?:\\\\.|[^\\\\"])*)"|(\S+))/u', $commandLine, $matches, offset: $offset) > 0){
|
||||||
|
Reference in New Issue
Block a user