-
-
Notifications
You must be signed in to change notification settings - Fork 707
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't get AnnotationToAttribute to work. #8384
Comments
Hi, I'm thinking of possible requirements:
If nothing helps, please share the |
I had PHP 8.2 on the webapp and the rector subdirectory. I then tried to install rector as a direct dev dependency to the webapp but still no luck. The attribute Class exists as I use symfony 6.4. I created a small demo with a freshly installed symfony (--version=lts --webapp) here to test: https://github.com/scuben/rector-demo-issue-8384
Despite https://github.com/scuben/rector-demo-issue-8384/blob/main/src/Controller/DummyController.php#L7 should be changed to the Attribute Version. |
Thanks for sharing! We'll be able to figure this out soon 👍 It seems the https://github.com/scuben/rector-demo-issue-8384/blob/main@%7B2024-01-04T08:46:43Z%7D/src/Controller/DummyController.php#L11 is already an #[Attribute]. Could you send the link to the @annotation form? |
Ah, I might completely misunderstand the rule. My goal is to change the use statement from use Is there a rule for that kind of migration? |
You can enable |
I updated the |
Are you sure you verify |
I see, it seems because the method already use attribute, so it can't change to attribute again. I suggest to use |
Great, that was the hint I needed. With the |
@scuben I see now, thanks for feedback. Reopening for myself to fix this. |
I have a symfony application and want to update all the Annotation-Route use statements with the new Attribute-Route use statement.
I installed rector in a subdirectory (tools/rector) but have my
rector.php
configuration in the top project level directory with that content:When I run:
tools/rector/vendor/bin/rector process --dry-run
I just get nothing:
[OK] Rector is done!
Do you have any hints to point me in the right direction?
The text was updated successfully, but these errors were encountered: