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
HeredocToNowdocFixer - Handle space in heredoc token #1879
HeredocToNowdocFixer - Handle space in heredoc token #1879
Conversation
Some of these test cases are invalid php. |
|
I think the fixer should not remove the spaces. |
Not removing the spaces results in a syntax error. |
Oh, ok, didn't know that. |
|
||
EOF | ||
, <<<'EOF' | ||
<?php $a = <<< "TEST" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, this is invalid. why isn't it failing in the travis build with enabled linting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errr, not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #1869
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<?php $a = <<< "TEST"
Foo
TEST;
echo $a;die;
runs for me, what part is invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about with single quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, all ok (PHP 5.5.9-1ubuntu4.14 (cli) (built: Oct 28 2015 01:34:46)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SpacePossum is right, both are valid.
it is valid: https://3v4l.org/GlPME So, I still think we should not remove the spaces. |
How come my other test file is getting broken then? |
Because the fixer does not handle the spaces correctly. |
because the opening quote was misplaced;
PR fixes to:
suggested is:
input
I guess? |
suggested is: <<< 'HTML' (single quotes) |
course :) |
I don't think so. 👍 🚢 |
👍 |
Is this good to merge @keradus? |
Yes, please rebase. |
I wonder if I can get gitHub to actually delete all the mess they've made. |
One one or another please rebase and put your thumb for #1903 ;) |
rtm :) |
why based on #1896 ? |
fixed |
👍 |
Thank you @SpacePossum. |
…Possum) This PR was merged into the 1.12 branch. Discussion ---------- HeredocToNowdocFixer - Handle space in heredoc token Closes #1869 ping @GrahamCampbell and @gharlan Commits ------- a550caf Handle with space in HereDoc name.
Closes #1869
ping @GrahamCampbell and @gharlan