-
-
Notifications
You must be signed in to change notification settings - Fork 687
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
Refactor Symfony route names and paths to snake_case with Rector #8868
Comments
Hi, thanks for proposal. Sounds good to me. Feel free to send the rule 👍 The best way to start is with the docs for custom rules: https://getrector.com/documentation/custom-rule |
Hi @TomasVotruba, Here’s the plan:
If you have any comments or concerns about anything, just let me know. I’m eager to hear your thoughts on this plan! |
Looks good. Let's start with the Rector rule 👍 |
Hi @TomasVotruba, I’ve successfully implemented the rule to modify all the annotations and attributes in Symfony routes. However, I'm now focusing on how to apply these modifications to Twig templates while considering dry-run mode. I started with the following code to update the Twig files:
The problem is that this approach modifies the files directly, which isn’t suitable for dry-run functionality. Could you suggest a way to simulate these changes in the Twig templates without applying them immediately? Any insights or recommendations would be greatly appreciated! Thank you! |
Rector can only handle PHP files. We've tried changing non-PHP files before, but it only lead to problems like you describe: We can either limit the rule to handle PHP, or better create a custom tool to handle your use case. |
Hi. Just a thought but couldn't
My 2 cents. |
Hey @JoolsMcFly, We could actually use |
Hi Rector team,
Following the recent acceptance of the proposal to use snake_case for routes in Symfony, as detailed in this Symfony documentation pull request, I’d like to suggest adding a Rector rule that automates the refactoring of route names and paths to snake_case.
Why is this useful?
Next Steps:
Looking forward to your feedback and guidance!
Best regards,
The text was updated successfully, but these errors were encountered: