-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Added HeredocToNowdocFixer #1580
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
Conversation
return array( | ||
array(<<<'EOF' | ||
<?php $a = <<<'TEST' | ||
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.
this test is useless. It is already covered by the later item (as makeTest
always ensure that applying the fixer on the expected output triggers no additional change)
Test request array(<<<'EOF'
<?php
$a = <<<TEST
'
TEST;
$a = <<<TEST
\$b = '<<<';
\$c = <=;
<<<'"$<<<'"
TEST;
EOF
),
maybe I messed up the test? |
yes. your code is invalid. it is missing a newline at end of code. |
I see, re-tested, all 👍 thanks! |
51d12c6
to
130c6b7
Compare
@stof should I move this fixer to symfony level? |
ping, anyone else? :) |
Try running it on Symfony and see how many changes are made. If there are very few, or none, then yes. ;) |
If there are few also send a PR for lowest maintained branch |
2.3, 2.7, 2.8, 3.0, master are the currently active branches on symfony atm btw. ;) |
yes, and CS fixes go from lowest. |
Yeh, it does. I do sometimes wonder why they bother with CS on a bug-fix only branch, but meh, they do. |
To have diff between branches as little as possible. |
made a pr for symfony. |
@keradus @GrahamCampbell the goal is to avoid having CS differences between branches, which would cause conflicts each time there is a change near such line which need to be merged into newer branches. We are merging maintained branches into each other on a weekly basis during the whole maintenance time (i.e. 3 years for LTS versions), so we don't want to have useless conflicts each time (which may lead to bad conflict resolution and introducing bugs or losing bug fixes in newer branches, as happened in the past already) |
Sure. ;) |
Cool for me @stof, that is why I asked to send that PR to lowest branch ;) |
|
||
$this->convertToNowdoc($token); | ||
$content = str_replace('\\\\', '\\', $content); | ||
$content = str_replace('\\$', '$', $content); |
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.
one str_replace would be enough?
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.
indeed, you can pass arrays to param 1 and 2
130c6b7
to
8f8efe6
Compare
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
As one can see in referenced commits - Symfony level |
Lol. Reference spam. |
It was for making sure we won't miss it ;P |
8f8efe6
to
455f08d
Compare
done |
👍 |
455f08d
to
1575798
Compare
1575798
to
b0739ee
Compare
👍 |
Thank you @gharlan. |
This PR was merged into the 1.12 branch. Discussion ---------- Added HeredocToNowdocFixer Commits ------- b0739ee Added HeredocToNowdocFixer
nice! 👍 :) |
This PR was merged into the 2.3 branch. Discussion ---------- CS: use nowdoc instead of heredoc | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | — | License | MIT | Doc PR | — if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580 Commits ------- 3dca549 use nowdoc instead of heredoc
No description provided.