php-graphql-client icon indicating copy to clipboard operation
php-graphql-client copied to clipboard

Fix PHP 8.4 deprecation warnings

Open TomA-R opened this issue 8 months ago • 0 comments

What / Why

Fix PHP 8.4 deprecation warnings:

php-graphql-client/src/Client.php:64
GraphQL\Client::__construct(): Implicitly marking parameter $httpClient as nullable is deprecated, the explicit nullable type must be used instead

php-graphql-client/src/Client.php:0
GraphQL\Client::__construct(): Implicitly marking parameter $auth as nullable is deprecated, the explicit nullable type must be used instead

In PHP 8.4 and above, nullable arguments need to be explicitly marked as such when providing a typehint. This can either be done by using the ? operator or by add "null" to the typehint through a union type. This PR addresses this, fixing deprecation warnings emitted by PHP 8.4.

See: https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated

TomA-R avatar Apr 24 '25 00:04 TomA-R