-
-
Notifications
You must be signed in to change notification settings - Fork 680
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
rector adding php open/close tags in view files #6836
Comments
In case someone could give me some pointers on where to start analyzing, I could try tominvestigate myself |
The service responsible for printing is Tip: Analyse just one file, it will make debugging much easier: vendor/bin/rector process src/SingleFile.php --debug |
just leaving some notes here of my ongoing analysis php-parser already contains code, which should prevent the php tags which are added in the repro case it seems this code is only used when using pretty-print but rector is using formatPreserving printing. rector is processing my view file 4 times. in the first view steps the html is still look like I expect but, in the process the first AST-node is turned into a |
given a view file with contents
running rector over it produces "unnecessary" changes.
rector adds php starting/ending tags in this files.
this unnecessary changes create noise in bigger PRs
I created a repo which reproduces this case
Steps
gh repo clone staabm/rector-repro1
composer install
vendor/bin/rector process -n
expected result
<?php ?>
at the beginning of the file<?php
actual result
The text was updated successfully, but these errors were encountered: