-
-
Notifications
You must be signed in to change notification settings - Fork 689
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 support for downgrading return type null #8324
Add support for downgrading return type null #8324
Comments
Hi, thanks for proposal. We actually don't support docblock-based types since Rector 0.15 https://getrector.com/blog/new-in-rector-015-complete-safe-and-known-type-declarations as it lead to false positive and breaking code in the past. We infer return/param/property type declarations from the code itself instead as the only safe way. Use the TYPE_DECLARATIONS set instead 👍 |
How does that help? This is a downgrade rector that downgrades unsupported features from php 8.2. Meaning if someone imports the downgrade set, it should downgrade everything it can to supported syntax. |
Ah, I confused the change other way around, my bad. That would be great addition. Could you open up PR? |
@samsonasik Could you add this rule to the PHP 8.2 set? |
I will try |
Feature Request
PHP 8.2 allows
null
to be used as a standalone return type.Diff
Use case 1, without parent:
Use case 2, with a parent:
The text was updated successfully, but these errors were encountered: