Skip to content

Commit a2f0250

Browse files
authored
PHP 8.2: explicitly declare CompositeCommand::$longdesc (#5707)
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.
1 parent 004f90c commit a2f0250

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

php/WP_CLI/Dispatcher/CompositeCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class CompositeCommand {
1616

1717
protected $name;
1818
protected $shortdesc;
19+
protected $longdesc;
1920
protected $synopsis;
2021
protected $docparser;
2122

0 commit comments

Comments
 (0)