Skip to content
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

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

Open
TomasVotruba opened this issue Jun 20, 2024 · 2 comments
Open

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

TomasVotruba opened this issue Jun 20, 2024 · 2 comments
Assignees
Labels

Comments

@TomasVotruba
Copy link
Member

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
@TomasVotruba TomasVotruba self-assigned this Jun 24, 2024
@megawubs
Copy link

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

@TomasVotruba
Copy link
Member Author

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

Here it is :) rectorphp/rector-src#6136

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants