From 8871acd01d8db0f855c0183fb116ab22544deac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Wrede?= Date: Wed, 21 Jun 2023 10:03:59 +0200 Subject: [PATCH] Fix PHP 8.1 deprecation: Return type --- php/WP_CLI/Iterators/Query.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/php/WP_CLI/Iterators/Query.php b/php/WP_CLI/Iterators/Query.php index a5727b05b7..b2b8e51ff7 100644 --- a/php/WP_CLI/Iterators/Query.php +++ b/php/WP_CLI/Iterators/Query.php @@ -88,19 +88,23 @@ private function load_items_from_db() { return true; } + #[\ReturnTypeWillChange] public function current() { return $this->results[ $this->index_in_results ]; } + #[\ReturnTypeWillChange] public function key() { return $this->global_index; } + #[\ReturnTypeWillChange] public function next() { $this->index_in_results++; $this->global_index++; } + #[\ReturnTypeWillChange] public function rewind() { $this->results = []; $this->global_index = 0; @@ -109,6 +113,7 @@ public function rewind() { $this->depleted = false; } + #[\ReturnTypeWillChange] public function valid() { if ( $this->depleted ) { return false;