-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
CS: use nowdoc instead of heredoc #17086
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
@@ -1,7 +1,7 @@ | |||
This template is used for translation message extraction tests< 8000 /span> | |||
<?php echo $view['translator']->trans('single-quoted key') ?> | |||
<?php echo $view['translator']->trans('double-quoted key') ?> | |||
<?php echo $view['translator']->trans(<<<EOF | |||
<?php echo $view['translator']->trans(<<<'EOF' |
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 must be reverted. It is precisely testing the extraction from heredoc (extracting from nowdoc is tested 3 lines later)
f5f8fa0
to
7ce6b7d
Compare
Personally, I'm |
We already force single quotes instead of double quotes (when possible). So in my opinion it would be consistent to do it the same way with nowdoc vs. heredoc. |
|
||
return \$this->doGenerate(\$variables, \$defaults, \$requirements, \$tokens, \$parameters, \$name, \$referenceType, \$hostTokens); | ||
return $this->doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens); |
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.
so cleaner with nowdoc ;)
👍 (not a big one but still :) ) |
👍 |
Thank you @gharlan. |
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
I merged 2.3 up to master without looking for more heredoc to change, which means they may be more in 2.7 and up. |
Great to hear @nicolas-grekas |
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
if this is accepted, we could add the fixer to symfony level of php-cs-fixer: PHP-CS-Fixer/PHP-CS-Fixer#1580