humanmade / altis-local-server

Local Server module for Altis
https://www.altis-dxp.com/resources/docs/local-server/
16 stars 4 forks source link

PHP 8.2 deprecation notices for out of date WP-CLI #742

Open svandragt opened 2 hours ago

svandragt commented 2 hours ago

When running WP-CLI commands on PHP 8.2, deprecation notices are showing due to using out of date WP-CLI.

The following is output from a custom command, returning more notices than normal:

PHP Deprecated:  Return type of WP_CLI\Iterators\Query::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 91
Deprecated: Return type of WP_CLI\Iterators\Query::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 91
PHP Deprecated:  Return type of WP_CLI\Iterators\Query::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 99
Deprecated: Return type of WP_CLI\Iterators\Query::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 99
PHP Deprecated:  Return type of WP_CLI\Iterators\Query::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 95
Deprecated: Return type of WP_CLI\Iterators\Query::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 95
PHP Deprecated:  Return type of WP_CLI\Iterators\Query::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 112
Deprecated: Return type of WP_CLI\Iterators\Query::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 112
PHP Deprecated:  Return type of WP_CLI\Iterators\Query::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 104
Deprecated: Return type of WP_CLI\Iterators\Query::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 104`

Steps to reproduce (requires Altis 20):

  1. composer server shell
  2. wp site list

Expect to see the site list, without deprecation notices.

Acceptance criteria:

svandragt commented 2 hours ago

At the time of writing the installed version with Altis 20 is WP-CLI 2.8.1, it's fixed in WP-CLI 2.11.