[EarlyReturn] Skip else has inline html on RemoveAlwaysElseRector#2870
[EarlyReturn] Skip else has inline html on RemoveAlwaysElseRector#2870TomasVotruba merged 5 commits intomainfrom
Conversation
# Failing Test for RemoveAlwaysElseRector Based on https://getrector.org/demo/eb0f5c8f-86e3-40ed-bb38-86675496f0c8
|
All checks have passed 🎉 @TomasVotruba it is ready for review. |
|
🥳 |
|
Afaik this is wrong, bc now it does nothing, even though this could easily be optimized. |
|
Feel free to provide patch if you have different solution :) |
|
Just brainstorming: if there are any PHP closing/opening tags we just need to keep them instead of removing them? Is there a way on the "demo" to load an older version of rector, to play around with the rule so I can check various cases? |
|
Rector is using nikic/php-parser, which replacing html+php may overap the index. Still, feel free to provide patch if you found a solution, otherwise, you can use Feel free to contribute by create PR to https://github.com/rectorphp/getrector.org if you have want to provide PR to improve demo page. |
|
How about we just report it instead of auto-fixing it? |
Closes #2867 Fixes rectorphp/rector#7441