feat: add ConvertAssignToNamedArgumentRector#7133
feat: add ConvertAssignToNamedArgumentRector#7133calebdw wants to merge 1 commit intorectorphp:mainfrom
Conversation
This converts function and method calls that contain arguments with assignments to named arguments.
|
Hey, This could break code as variable is removed. |
|
@TomasVotruba, this can't break code because I check to make sure that the variable is not used in the rest of the code prior to removing---I have tests that show this is working |
|
Still looks like too niche to be part of core. Every rule we have here is most likely part of default set. That comes with performance hit, so rules must be practical in the wild, no to slow down run for near-zero gain. |
|
So you're saying that you've never seen this legacy pattern in other codebases and have manually converted them to named arguments? These are variables that aren't used anywhere else and is just like using Would you be willing to accept this if was removed from the PHP 8 set and instead had to manually be included by the user? If not that's fine, but I'm tried of seeing this pattern and having to manually update in my work codebase, and I can't imagine that I'm the only one |
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
Hello!
Closes rectorphp/rector#9302
This converts function and method calls that contain arguments with assignments to named arguments if the variable is not used in subsequent statements. This is a legacy pattern to give insight into the parameter name before named arguments were introduced in PHP 8
Thanks!