rector
rector copied to clipboard
Explore way Rector or another tool can process blade templates
This is one of pain points when using Rector with Laravel. It works well on PHP code, but fails on Blade.
Often Blade uses simle structures like PHP functions calls, that ought to be refactored.
Ref: https://x.com/_damms005/status/1802693660405866911
Brainstorm ideas:
- have a separate command for blade templates
- it would run Rector in a simple way, parsing only code inside {{ ... }}, and @php tags
- it would not reprint the whole file, but a just these snippets using str_replace
Is there a way to help out with this? I'm currently running into this missing feature of Rector
I made a WIP few weeks ago, but it needs more work ↓
Here it is :) https://github.com/rectorphp/rector-src/pull/6136
Not a priority atm