diff --git a/composer.json b/composer.json index 393e035a0..f9166dc5d 100644 --- a/composer.json +++ b/composer.json @@ -48,7 +48,10 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "php-http/discovery": true + } }, "scripts": { "phpcs": [ diff --git a/src/Elasticsearch/Helper/Iterators/SearchHitIterator.php b/src/Elasticsearch/Helper/Iterators/SearchHitIterator.php index 85c645e4c..6b50b6f45 100644 --- a/src/Elasticsearch/Helper/Iterators/SearchHitIterator.php +++ b/src/Elasticsearch/Helper/Iterators/SearchHitIterator.php @@ -69,6 +69,7 @@ public function __construct(SearchResponseIterator $search_responses) * @return void * @see Iterator::rewind() */ + #[\ReturnTypeWillChange] public function rewind() { $this->current_key = 0; @@ -96,6 +97,7 @@ public function rewind() * @return void * @see Iterator::next() */ + #[\ReturnTypeWillChange] public function next() { $this->current_key++; @@ -115,6 +117,7 @@ public function next() * @return bool * @see Iterator::valid() */ + #[\ReturnTypeWillChange] public function valid() { return is_array($this->current_hit_data); @@ -126,6 +129,7 @@ public function valid() * @return array * @see Iterator::current() */ + #[\ReturnTypeWillChange] public function current() { return $this->current_hit_data; @@ -137,6 +141,7 @@ public function current() * @return int * @see Iterator::key() */ + #[\ReturnTypeWillChange] public function key() { return $this->current_key; @@ -161,6 +166,7 @@ private function readPageData() /** * {@inheritDoc} */ + #[\ReturnTypeWillChange] public function count() { if ($this->count === null) { diff --git a/src/Elasticsearch/Helper/Iterators/SearchResponseIterator.php b/src/Elasticsearch/Helper/Iterators/SearchResponseIterator.php index 0f6d5ac87..09c5cc10e 100644 --- a/src/Elasticsearch/Helper/Iterators/SearchResponseIterator.php +++ b/src/Elasticsearch/Helper/Iterators/SearchResponseIterator.php @@ -123,6 +123,7 @@ private function clearScroll() * @return void * @see Iterator::rewind() */ + #[\ReturnTypeWillChange] public function rewind() { $this->clearScroll(); @@ -137,6 +138,7 @@ public function rewind() * @return void * @see Iterator::next() */ + #[\ReturnTypeWillChange] public function next() { $this->current_scrolled_response = $this->client->scroll([ @@ -153,6 +155,7 @@ public function next() * @return bool * @see Iterator::valid() */ + #[\ReturnTypeWillChange] public function valid() { return isset($this->current_scrolled_response['hits']['hits'][0]); @@ -164,6 +167,7 @@ public function valid() * @return array * @see Iterator::current() */ + #[\ReturnTypeWillChange] public function current() { return $this->current_scrolled_response; @@ -175,6 +179,7 @@ public function current() * @return int * @see Iterator::key() */ + #[\ReturnTypeWillChange] public function key() { return $this->current_key; diff --git a/tests/Elasticsearch/Tests/Helper/Iterators/SearchHitIteratorTest.php b/tests/Elasticsearch/Tests/Helper/Iterators/SearchHitIteratorTest.php index 80dcd2539..b669c7229 100644 --- a/tests/Elasticsearch/Tests/Helper/Iterators/SearchHitIteratorTest.php +++ b/tests/Elasticsearch/Tests/Helper/Iterators/SearchHitIteratorTest.php @@ -26,6 +26,7 @@ * Class SearchResponseIteratorTest * */ +#[\AllowDynamicProperties] class SearchHitIteratorTest extends \PHPUnit\Framework\TestCase { diff --git a/tests/Elasticsearch/Tests/TransportTest.php b/tests/Elasticsearch/Tests/TransportTest.php index 84923c167..113f49fe2 100644 --- a/tests/Elasticsearch/Tests/TransportTest.php +++ b/tests/Elasticsearch/Tests/TransportTest.php @@ -29,6 +29,7 @@ use Psr\Log\LoggerInterface; use React\Promise\Deferred; +#[\AllowDynamicProperties] class TransportTest extends TestCase { public function setUp(): void