feat: add AddNamedArgumentsRector#6678
Conversation
| use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; | ||
| use const PHP_VERSION_ID; | ||
|
|
||
| final class AddNamedArgumentsRector extends AbstractRector |
There was a problem hiding this comment.
make implements Rector\VersionBonding\Contract\MinPhpVersionInterface instead of manual check on refactor.
| $parameters = $this->getParameters($node); | ||
| $this->addNamesToArgs($node, $parameters); |
There was a problem hiding this comment.
add hasChanged flag so can return null on no change
|
Hi, thanks for the proposal. Maintenance cost with renamed ctor args, renamed classes and then params could go to huge extreme. Saying that, create this as a custom rule for your project, that fits your team needs 😇 |
|
Thank you guys for incredibly fast feedback :) |
|
For anyone searching it, I made a standalone repo |
|
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. |
In two words this feature doing this:
Also for functions, static methods, constructors
It seems for me and my teammates that code with named arguments less prone to errors and more readable