Skip to content

Conversation

TomA-R
Copy link

@TomA-R TomA-R commented Apr 24, 2025

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

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 adding "null" to the typehint through a union type. This PR addresses this, fixing deprecation warnings emitted by PHP 8.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant