PHP 8.2: explicitly declare CompositeCommand::$longdesc to fix deprecation warning#5707
Merged
danielbachhuber merged 1 commit intowp-cli:mainfrom Nov 29, 2022
Merged
Conversation
This commit fixes the following deprecation warnings when running `wp --info` with PHP 8.2 RC6: ``` Deprecated: Creation of dynamic property WP_CLI\Dispatcher\CompositeCommand::$longdesc is deprecated in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php on line 38 Deprecated: Creation of dynamic property WP_CLI\Dispatcher\Subcommand::$longdesc is deprecated in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php on line 38 Deprecated: Creation of dynamic property WP_CLI\Dispatcher\CommandNamespace::$longdesc is deprecated in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php on line 38 ``` Dynamic properties are deprecated in PHP 8.2. The solution was to simply declare CompositeCommand::$longdesc before it is used.
Contributor
Author
|
I'm currently testing a plugin that I maintain with PHP 8.2. Besides this deprecation warning, I saw a few others in some WP-CLI packages. Please let me know if PRs like this one help, and I will create a few more in the corresponding repositories. |
Member
That would be great, thank you! |
danielbachhuber
approved these changes
Nov 29, 2022
Contributor
Author
|
Thanks for quickly reviewing and approving this PR.
In the end, it was just one deprecation notice in one package: wp-cli/i18n-command#346 |
2 tasks
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.
This PR fixes the following deprecation warnings when running
wp --infowith PHP 8.2 RC6:Dynamic properties are deprecated in PHP 8.2. The solution was to simply declare CompositeCommand::$longdesc before it is used.