elastic / elasticsearch-php

Official PHP client for Elasticsearch.
https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html
MIT License
5.25k stars 963 forks source link

`Response\Elasticsearch::offsetGet()` return type declaration #1384

Closed AnnaNtagiou closed 5 months ago

AnnaNtagiou commented 7 months ago

Summary of problem or feature request

There is a deprecation notice for the Response\Elasticsearch::offsetGet() related to the return type.

Code snippet of problem

Method "ArrayAccess::offsetGet()" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Elastic\Elasticsearch\Response\Elasticsearch" now to avoid errors or add an explicit @return annotation to suppress this message.

System details

ezimuel commented 7 months ago

@AnnaNtagiou why are you using elasticsearch-php 7.17 with Elasticsearch 8? You should upgrade the client to version 8, using "elasticsearch/elasticsearch": "^8" in composer. If you need more information on upgrade to version 8, you can read this notes.

AnnaNtagiou commented 7 months ago

@ezimuel, I made a mistake. I am using the docker image elasticsearch:7.17.11 and trying to upgrade the client from 7.17.2 to version 8.11 using "elasticsearch/elasticsearch": "^8.11" in composer. If everything goes well, I would also like to upgrade the docker image to 8.11.