Repository navigation
Conversation
The formatter wrote every heredoc as <<<EOT: a nowdoc became a heredoc, whose body PHP interpolates, and a body line starting with EOT ended it early. The printer wrote ) or , right after the closing label, which PHP before 7.3 rejects.
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.
The formatter wrote every heredoc and nowdoc as
<<<EOT:$xand\tin<<<'TXT'turned into a variable and a tab.EOTended the heredoc early.It now keeps the label and the nowdoc quotes. Where a body line would end the heredoc, it picks another label (
TXT1,TXT2, ...). The closing token is nowT_END_HEREDOCinstead ofT_START_HEREDOC.The printer also wrote what follows a heredoc on the closing label's line, for example
EOT), 1;, which PHP before 7.3 rejects. It now starts a new line there unless a semicolon follows.Added formatter tests for a nowdoc, a body line holding the label, and a heredoc passed as an argument.