savinmikhail / add_named_arguments_rector
Rector rule to add names to arguments for functions'/methods' calls
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:rector-extension
Requires
- php: >=8.2
- nikic/php-parser: ^4.15 || ^5.1
- phpstan/phpstan: ^2.1.1
- rector/rector: ^2.0.0
- symplify/rule-doc-generator-contracts: ^11.2
Requires (Dev)
- ergebnis/composer-normalize: ^2.45
- friendsofphp/php-cs-fixer: ^3.62
- icanhazstring/composer-unused: ^0.8.11
- maglnet/composer-require-checker: ^4.14
- phpunit/phpunit: ^10.5
- phpyh/coding-standard: ^2.6.1
README
In two words this feature doing this:
- (new DateTimeImmutable())->format('Y-m-d'); + (new DateTimeImmutable())->format(format: 'Y-m-d');
- 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
I made this rule standalone, due to discussion
Installation
composer require --dev savinmikhail/add_named_arguments_rector
Usage
Add new rule to your rector.php config file like that:
<?php declare(strict_types=1); use Rector\Config\RectorConfig; return RectorConfig::configure() ->withRules([ \SavinMikhail\AddNamedArgumentsRector\AddNamedArgumentsRector::class ]);