Skip to content

Fix strict standard error about variable reference#3380

Merged
danielbachhuber merged 1 commit into
wp-cli:masterfrom
shulard:fix/strict-standard
Sep 8, 2016
Merged

Fix strict standard error about variable reference#3380
danielbachhuber merged 1 commit into
wp-cli:masterfrom
shulard:fix/strict-standard

Conversation

@shulard
Copy link
Copy Markdown

@shulard shulard commented Sep 8, 2016

When ran the command wp core language update I got the following error :

PHP Strict standards:  Only variables should be passed by reference in .../wp-cli/wp-cli/php/WP_CLI/CommandWithTranslation.php on line 169
PHP Stack trace:
PHP   1. {main}() .../wp-cli/wp-cli/php/boot-fs.php:0
PHP   2. include() .../wp-cli/wp-cli/php/boot-fs.php:17
PHP   3. WP_CLI\Runner->start() .../wp-cli/wp-cli/php/wp-cli.php:21
PHP   4. WP_CLI\Runner->_run_command() .../wp-cli/wp-cli/php/WP_CLI/Runner.php:906
PHP   5. WP_CLI\Runner->run_command() .../wp-cli/wp-cli/php/WP_CLI/Runner.php:319
PHP   6. WP_CLI\Dispatcher\Subcommand->invoke() .../wp-cli/wp-cli/php/WP_CLI/Runner.php:312
PHP   7. call_user_func:{.../wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372}() .../wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372
PHP   8. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}() .../wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:372
PHP   9. call_user_func:{.../wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:67}() .../wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:67
PHP  10. WP_CLI\CommandWithTranslation->update() .../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.

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.
@danielbachhuber
Copy link
Copy Markdown
Member

Thanks!

@danielbachhuber
Copy link
Copy Markdown
Member

Build fails on trunk because of #3384

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants