Skip to content

Conversation

@jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Sep 16, 2024

PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameters with a null default value, which are not explicitly declared as nullable.

As the minimums supported PHP version of this code base is PHP 5.6, adding the nullability operator to the type declaration is not an option at this time.

In this case, however, the parameter is found in the declaration of a private method, so removing the type declaration in favour of in-function type checking solves the deprecation without breaking BC (as private).

Includes updating the documentation to match (where relevant, i.e. only existing documentation has been touched).

Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types

PHP 8.4 deprecates implicitly nullable parameters, i.e. typed parameters with a `null` default value, which are not explicitly declared as nullable.

As the minimums supported PHP version of this code base is PHP 5.6, adding the nullability operator to the type declaration is not an option at this time.

In this case, however, the parameter is found in the declaration of a `private` method, so removing the type declaration in favour of in-function type checking solves the deprecation without breaking BC (as `private`).

Includes updating the documentation to match (where relevant, i.e. only existing documentation has been touched).

Ref: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
@jrfnl jrfnl requested a review from a team as a code owner September 16, 2024 18:36
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.

3 participants