Skip to content
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

Mark as nullable arguments with initial null value #28

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

acelaya
Copy link

@acelaya acelaya commented Dec 1, 2024

This PR fixes some deprecation warnings thrown with PHP 8.4 due to implicit nullability in some method arguments.

The solution involves explicitly marking them as nullable with ?string $foo = null instead of string $foo = null.

See the RFC for details https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

Additionally, I also added PHP 8.4 to the php workflow, to verify deprecation warnings are not printed.

@WyriHaximus WyriHaximus added the bug Something isn't working label Dec 1, 2024
Copy link
Collaborator

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, leaving it up to @DEVizzent to decide if this is a breaking change for the interfaces and needs a new major or not. Thanks for putting this together 👍

@acelaya
Copy link
Author

acelaya commented Dec 2, 2024

The changes in interfaces are not breaking changes. Anyone who's implementing them in userland code and does not explicitly define the nullable type, can safely update to this and won't get any error.

See https://3v4l.org/1Wcnh

@WyriHaximus
Copy link
Collaborator

The changes in interfaces are not breaking changes. Anyone who's implementing them in userland code and does not explicitly define the nullable type, can safely update to this and won't get any error.

See https://3v4l.org/1Wcnh

Fair, forgot about that one 😅

@DEVizzent DEVizzent merged commit 44920bc into DEVizzent:master Dec 3, 2024
54 checks passed
@acelaya acelaya deleted the php-8.4-deprecations branch December 3, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants