Fix regression that broke extending existing commands by schlessera · Pull Request #5563 · wp-cli/wp-cli
Conversation
There was a regression in the code that handles command namespaces that made it impossible to extend an existing command class.
This PR reverts the regression and adds a test scenario to ensure this type of extension will not be regressing again.
Fixes #5274
sun approved these changes Sep 30, 2021
sun
left a comment
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simple fix accompanied with tests, which are passing. 👍
Wondering whether we should restore the final condition testing for other possible values of existing commands that were removed in the previous commit that introduced the test for false in #5203?
| } elseif ( false !== $existing_command ) { | |
| // Command already registered, so abort to avoid double registration. | |
| return false; | |
| } |
Wondering whether we should restore the final condition testing for other possible values of existing commands that were removed in the previous commit that introduced the test for false in #5203?
I think that would make it impossible again to override bundled commands, as the new command would just be skipped.
schlessera
deleted the
fix/5274-allow-extending-bundled-commands
branch
This was referenced
Jan 6, 2022
Dan-Q
mentioned this pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters