ray / rector-ray
Rector upgrades rules for Ray.Di
Installs: 40 108
Dependents: 5
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:rector-extension
Requires
- php: >=8.0
- koriym/attributes: ^1.0
- ray/di: ^2.14
Requires (Dev)
- doctrine/coding-standard: ^12.0.0
- phpunit/phpunit: ^9.5
- rector/rector: ^0.16.0
- vimeo/psalm: ^4.29
This package is auto-updated.
Last update: 2024-10-30 05:12:56 UTC
README
The rector/rector rules for Ray.Di.
Install
composer require ray/rector-ray --dev
Rules
AnnotationBindingRector
This Rector converts annotation bindings in PHPDoc into parameter attribute bindings.
🔧 configure it!
- class:
AnnotationBindingRector
use PHPStan\Type\ObjectType; use Rector\Arguments\Rector\ClassMethod\ArgumentAdderRector; use Rector\Arguments\ValueObject\ArgumentAdder; use Rector\Config\RectorConfig; return static function (RectorConfig $rectorConfig): void { $rectorConfig->ruleWithConfiguration( AnnotationBindingRector::class ); };
↓
class SomeClass { /** - * @Named("a=foo, b=bar") * @Foo */ - public function __construct(int $a, int $b) + public function __construct(#[Named('foo')] int $a, #[Named('bar')] int $b) { }
- /** - * @Foo("a") - */ - public function __construct(int $a, int $b) + public function __construct(#[Foo] int $a, int $b) { }