Keep empty php code as is#3395
Merged
TomasVotruba merged 1 commit intorectorphp:masterfrom May 20, 2020
Merged
Conversation
Member
|
Just for reference: it was added for CakePHP to Symfony rules, that are no longer present: 81531b2#diff-560bcf8e3b306989b3cb6718d0403d0c Thanks 👍 |
Contributor
Author
|
@TomasVotruba It seems that this PR is not merged yet to |
Member
|
Why do you think so? I see it right there: Also commit is in the |
Contributor
Author
|
Sorry, must be something in my internet connection :( It kept showing me |
Contributor
Author
|
Closes #3352 |
TomasVotruba
added a commit
that referenced
this pull request
Feb 21, 2023
rectorphp/rector-src@f9f4217 [e2e] [printer] Fix short open tag mixed php+html cause surplus <?php (#3395)
TomasVotruba
added a commit
that referenced
this pull request
Feb 21, 2023
rectorphp/rector-src@f9f4217 [e2e] [printer] Fix short open tag mixed php+html cause surplus <?php (#3395)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

(Resolving the same type of issue as in #3394)
To maintain the assumption, that rector would only change what it was instructed to, when there's an empty php code
<?php ?>, we want to preserve it.You can see an example of when it's necessary here: #3352 (comment)
Removing empty php code should be a specific Rector rule that people can opt-in to run, instead of automatically being removed every time Rector runs.