rectorphp / rector

Instant Upgrades and Automated Refactoring of any PHP 5.3+ code
https://getrector.com
MIT License
8.59k stars 680 forks source link

Explore way Rector or another tool can process blade templates #8677

Open TomasVotruba opened 2 months ago

TomasVotruba commented 2 months ago

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:

megawubs commented 2 months ago

Is there a way to help out with this? I'm currently running into this missing feature of Rector

TomasVotruba commented 2 months ago

I made a WIP few weeks ago, but it needs more work ↓

Here it is :) https://github.com/rectorphp/rector-src/pull/6136