I was checking whether I could use rector to change my PHP-DI @Inject annotation-based dependency injections to constructor based injections.
To my big surprise I found out about an already existing rector:
https://github.com/rectorphp/rector/blob/master/docs/AllRectorsOverview.md#jmsinjectannotationrector
The only difference seems to be that the PHP-DI @Inject annotation does not have/use a namespace. That made me wonder, instead of making a new rector, would it be a (good) idea to change https://github.com/rectorphp/rector/blob/fac1503915aea843a3c123a5c622ecf0708bda62/packages/Jms/src/Rector/Property/JmsInjectAnnotationRector.php in such a way that the namespace of the annotation can be configured / left empty, probably defaulting to
|
private const INJECT_ANNOTATION = 'JMS\DiExtraBundle\Annotation\Inject'; |
I was checking whether I could use rector to change my PHP-DI @Inject annotation-based dependency injections to constructor based injections.
To my big surprise I found out about an already existing rector:
https://github.com/rectorphp/rector/blob/master/docs/AllRectorsOverview.md#jmsinjectannotationrector
The only difference seems to be that the PHP-DI
@Injectannotation does not have/use a namespace. That made me wonder, instead of making a new rector, would it be a (good) idea to change https://github.com/rectorphp/rector/blob/fac1503915aea843a3c123a5c622ecf0708bda62/packages/Jms/src/Rector/Property/JmsInjectAnnotationRector.php in such a way that the namespace of the annotation can be configured / left empty, probably defaulting torector/packages/Jms/src/Rector/Property/JmsInjectAnnotationRector.php
Line 28 in fac1503