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

Add rule to detect implicitly nullable native types #11413

Closed
thg2k opened this issue Jul 30, 2024 · 4 comments
Closed

Add rule to detect implicitly nullable native types #11413

thg2k opened this issue Jul 30, 2024 · 4 comments

Comments

@thg2k
Copy link

thg2k commented Jul 30, 2024

Feature request

With the very unfortunate acceptance of the implicitly nullable types deprecation RFC the following signature:

function foo(int $a = null): void

Will rise the following deprecation error in PHP 8.4:

Deprecated: foo(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead

I believe it would be useful to have a bleeding edge feature toggle to prepare for this change.

Did PHPStan help you today? Did it make you happy in any way?

No response

@ondrejmirtes
Copy link
Member

It doesn't have to be bleedingEdge, but it only will be reported when running on PHP 8.4, or when phpVersion is set to 80400 or higher.

@thg2k
Copy link
Author

thg2k commented Jul 30, 2024

It would be nice to have it as feature toggle to test it on lower versions as well, but I suppose one can just bump the global phpVersion parameter...

@ondrejmirtes
Copy link
Member

Implemented phpstan/phpstan-src@9bd027c

Copy link

github-actions bot commented Oct 7, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants