Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.1 deprecation: Return type of WP_CLI\Iterators\Query #5806

Closed
Soean opened this issue Jun 21, 2023 · 0 comments · Fixed by #5807
Closed

PHP 8.1 deprecation: Return type of WP_CLI\Iterators\Query #5806

Soean opened this issue Jun 21, 2023 · 0 comments · Fixed by #5807

Comments

@Soean
Copy link
Contributor

Soean commented Jun 21, 2023

Bug Report

The Query iterator has a deprecation warning. We should add #[\ReturnTypeWillChange] like in #5743

PHP: 8.1.18
WP CLI: 2.8.1
WordPress 6.2.2

Command: wp site list

Error:

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 /wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 91
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 /wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 99
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 /wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 95
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 /wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 112
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 /wp-cli/wp-cli/php/WP_CLI/Iterators/Query.php on line 104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant