Re-add subcommands on all composite commands that are overwritten by schlessera · Pull Request #5584 · wp-cli/wp-cli
This is a follow-up to #5563 .
Instead of only porting over subcommand on command namespace, we're doing so on all composite commands. This way, if a command is registered multiple times, it will still work as expected, while still allowing overrides.
The override needs to be registered as a subcommand in the new composite command, so it will take precedence over the subcommand that were previously registered.
Also, this adapts PHPUnit tests to make them work on PHP 8.1.