elastic / elasticsearch-php

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

PHP 8.4 Deprecations in ClientBuilder #1413

Open TimWolla opened 3 weeks ago

TimWolla commented 3 weeks ago

Using elasticsearch-php in PHP 8.4 emits 3 deprecation notices when loading ClientBuilder, due to the https://wiki.php.net/rfc/deprecate-implicitly-nullable-types RFC:

Deprecated: Elastic\Elasticsearch\ClientBuilder::setApiKey(): Implicitly marking parameter $id as nullable is deprecated, the explicit nullable type must be used instead in src/ClientBuilder.php on line 229

Deprecated: Elastic\Elasticsearch\ClientBuilder::setSSLCert(): Implicitly marking parameter $password as nullable is deprecated, the explicit nullable type must be used instead in src/ClientBuilder.php on line 275

Deprecated: Elastic\Elasticsearch\ClientBuilder::setSSLKey(): Implicitly marking parameter $password as nullable is deprecated, the explicit nullable type must be used instead in src/ClientBuilder.php on line 298

As far as I can tell there are no other issues with elasticsearch-php itself when running the test suite using PHP 8.4. Only the php-http/mock-client dependency reports a similar deprecation.