8000 Test improvements, use Nowdoc instead of Heredoc if possible by fre5h · Pull Request #600 · symfony/flex · GitHub
[go: up one dir, main page]

Skip to content

Test improvements, use Nowdoc instead of Heredoc if possible #600

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

Closed
wants to merge 1 commit into from

Conversation

fre5h
Copy link
@fre5h fre5h commented Jan 17, 2020

No description provided.

@Pierstoval
Copy link
Contributor

Is there any particular reason for this change? I'm curious

@fre5h
Copy link
Author
fre5h commented Jan 20, 2020

@Pierstoval From the official PHP documentation

A nowdoc is specified similarly to a heredoc, but no parsing is done inside a nowdoc.

https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc

@Pierstoval
Copy link
Contributor
Pierstoval commented Jan 20, 2020

I know this difference, but this doesn't seem to me like a recommendation. There's no mention of heredoc nor nowdoc in PSRs either, that's why I'm asking why you think it would be better to use one over the other in Flex. I'm not against the change, I'm just curious :)

@fre5h
Copy link
Author
fre5h commented Jan 20, 2020

It's only the micro-optimization. I found it, when explored code of Symfony Flex. I updated only those strings, which don't contain php variables inside, so heredoc could be changed with nowdoc without side effects.

@Pierstoval
Copy link
Contributor

Seems fair 👍

@nicolas-grekas
Copy link
Member
nicolas-grekas commented Jan 22, 2020

Thank you. I'm going to close because we don't do CS changes when they can't be enforced by our CS checker, fabbot based on php-cs-fixer. Without a bot, these changes are arbitrary and the "target" achieved here won't last long as a future PR might break it very easily.

Thanks for proposing.

@gharlan
Copy link
Contributor
gharlan commented Apr 2, 2020

(php-cs-fixer has a fixer for this (HeredocToNowdocFixer), it was applied once to symfony/symfony, but symfony doesn't want to use it: PHP-CS-Fixer/PHP-CS-Fixer#2413 8280 )

tgalopin pushed a commit to tgalopin/flex that referenced this pull request Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0