-
-
Notifications
You must be signed in to change notification settings - Fork 672
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
Rule to convert "@param int|null $param" to "function method(?int $param)" #8623
Comments
If the |
@samsonasik Not sure how to adjust the piece of code:
in my
|
You can add type declaration with $rectorConfig->sets([
LevelSetList::UP_TO_PHP_81,
+ \Rector\Set\ValueObject\SetList::TYPE_DECLARATION
]); |
Hi @samsonasik, it's not working. Also, this refactoring is not working:
to
|
Update protected property may cause BC break on child classes, that's why it disabled by default, you can either make it private first: https://getrector.com/demo/1a5cc52e-b860-434e-b4d2-805f57df040e of use https://getrector.com/demo/a55f7384-e2b1-412e-9038-650537961e4f with beware: it may cause bc break. You can learn configurable example on the rule itself
|
@samsonasik I have this class file & rector file:
And
|
You may have the target When you want to be typed hinted, the see again my original example https://getrector.com/demo/7ae2d2a6-2697-4c30-b04b-54ed12d824c7 |
Hello rector users,
I am struggling to find the
rectorphp
rule that converts the following code:to
FYI, I am using
LevelSetList::UP_TO_PHP_81
The text was updated successfully, but these errors were encountered: