Fix strict standard error about variable reference#3380
Merged
Conversation
When ran the command `wp core language update` I got the following error :
```
PHP Strict standards: Only variables should be passed by reference in /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/CommandWithTranslation.php on line 169
PHP Stack trace:
PHP 1. {main}() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/boot-fs.php:0
PHP 2. include() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/boot-fs.php:17
PHP 3. WP_CLI\Runner->start() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/wp-cli.php:21
PHP 4. WP_CLI\Runner->_run_command() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:906
PHP 5. WP_CLI\Runner->run_command() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:319
PHP 6. WP_CLI\Dispatcher\Subcommand->invoke() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:312
PHP 7. call_user_func:{/Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372}() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372
PHP 8. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372
PHP 9. call_user_func:{/Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:67}() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:67
PHP 10. WP_CLI\CommandWithTranslation->update() /Users/shulard/Sites/Clients/Cher Ami/schneider-life-is-on/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:67
```
It's about the `array_shift` call on the `get_plugins` function result directly.
This commit fix that by introducing a transition variable.
9f1694d to
b456ae7
Compare
Member
|
Thanks! |
Member
|
Build fails on trunk because of #3384 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When ran the command
wp core language updateI got the following error :It's about the
array_shiftcall on theget_pluginsfunction result directly.This commit fix that by introducing a transition variable.