You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please clearly document that currently rector does not reliably support files where PHP closing tags are used, except at the end of the file.
Lots of rules create fatal errors in files when you have a PHP closing tag somewhere in a file - which is incredibly common in legacy projects, which psalm is made for.
When reporting these errors it's always only met with #8465 (comment) but there's no mention of this anywhere in the docs - this should be something that's at the forefront, unless you want rector's users to spend hours checking/wasting their time why rector creates fatal errors in various files.
The text was updated successfully, but these errors were encountered:
The php-parser printer limitations are applied on any tool using it, not just Rector. The linked comment is right, as that's inherited trait. I recommend to promote the issue there, as fixing it would help all tools running on legacy projects.
I personally do not recommend to run any php-parser printer tool on mix of PHP/HTML.
Yes, but the documentation is wrong and a understatement at best.
The problem isn't a mix of PHP/HTML - it can happen with anything after PHP closing tags and has nothing to do with HTML.
Also clearly stating that the "fixed" code could be invalid PHP and may trigger fatal errors would make it clear that this is an issue, bc right now it's clearly very understated
you may need to manually verify the changed file
especially given that you claim "Automated Refactoring" in the title? Not really automated when I have to manually verify each and every file, since rector may add fatal errors, is it?
EDIT: in no way I want to attack you or rector, I just want to help other users have clear expectations when starting to use rector and being aware that this can be a problem that can happen and to not abandon rector in case it does happen - since the fix is to just disable those rector rules for files where non-PHP is used.
I just took a look at #8465 again which was closed bc of lack of php-parser support.
However the AST shows \PhpParser\Node\Stmt\InlineHTML correctly, doesn't it?
Since you link to php-parser not supporting php+html, could you perhaps link to a github issue where this issue is reported? I only found 1 which was marked as completed nikic/PHP-Parser#344 (comment) and it's seems for most cases that php-parser handles php+non-php fine now?
Bug Report
Please clearly document that currently rector does not reliably support files where PHP closing tags are used, except at the end of the file.
Lots of rules create fatal errors in files when you have a PHP closing tag somewhere in a file - which is incredibly common in legacy projects, which psalm is made for.
When reporting these errors it's always only met with #8465 (comment) but there's no mention of this anywhere in the docs - this should be something that's at the forefront, unless you want rector's users to spend hours checking/wasting their time why rector creates fatal errors in various files.
The text was updated successfully, but these errors were encountered: