Commit Graph

14 Commits

Author SHA1 Message Date
Dylan K. Taylor
ff2391e74a FormattedCommandAlias: use new string for description 2022-11-15 15:26:55 +00:00
Dylan K. Taylor
1572b31b8d FormattedCommandAlias: do not fill empty strings for missing placeholder arguments
this is pretty much always going to cause unexpected behaviour, as most execute() implementations don't expect empty strings, and it can also pad the args with dummy entries, breaking argument count requirements (e.g. aliasing say  and using the alias with no arguments will confuse the target command).

Instead:
- Drop arguments that cannot be resolved (leave them unspecified)
- If they are at the end of the argument sequence, this is OK - it will behave the same as if some optional arguments weren't specified.
- If they are in the middle of the argument sequence, this will generate an error - this is preferable to having the target invoked with an empty string, which might cause unexpected behaviour.

fixes #5379
2022-11-02 15:02:29 +00:00
Dylan K. Taylor
becbd562d6 FormattedCommandAlias: fixed incorrect arguments array being passed to the target 2022-06-07 19:47:45 +01:00
Dylan K. Taylor
38d6284671 Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
d4b7f66e15 Promote some constructors 2022-05-17 22:34:58 +01:00
Dylan K. Taylor
3e1246acff FormattedCommandAlias: Invoke commands directly with pre-parsed arguments
this resolves a range of issues with quoted arguments when using placeholders, as well as improving performance (no redundant combine -> re-parse needed).
2022-05-10 16:03:09 +01:00
Dylan K. Taylor
a353872327 FormattedCommandAlias: match placeholders using regex 2022-05-01 21:16:13 +01:00
Dylan K. Taylor
f4d71d0b48 FormattedCommandAlias: reduce complexity of buildCommand() 2022-05-01 21:04:38 +01:00
Dylan K. Taylor
dca457b1e0 Modernize property declarations in pocketmine\command namespace 2022-04-25 13:09:14 +01:00
Dylan K. Taylor
2f32bd877a Replace disallowed operators in src/command/ 2022-01-20 16:49:58 +00:00
Dylan K. Taylor
dedf81a9af Merge commit 'e61c3e8bf697e5c5c6cddb4843b24279faaf25cb' 2020-01-31 19:12:32 +00:00
Dylan K. Taylor
67bcc1c0fb phpdoc armageddon for master, pass 1 2020-01-22 11:55:03 +00:00
Dylan K. Taylor
cda1143a79 Merge branch 'stable' 2020-01-09 17:17:42 +00:00
Dylan K. Taylor
5499ac620c Removed pocketmine subdirectory, map PSR-4 style 2019-07-30 19:14:57 +01:00