Skip to content

Fix PHP 8.4 deprecation warnings #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

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