Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Console] Support iterable in SymfonyStyle::write/writeln#26863
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ro0NL commentedApr 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Should/Can we update |
ogizanagi commentedApr 8, 2018
These methods are not part of |
ogizanagi commentedApr 8, 2018
(I'm not convinced enabling support for iterables in |
ro0NL commentedApr 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
edit:
Well we did it for |
ogizanagi commentedApr 8, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't see many use cases for generators when displaying blocks, title, sections, etc... while |
chalasr left a comment
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.
with minor comment
| $output->writeln('Lorem ipsum dolor sit amet'); | ||
| $output->newLine(2);//Should append an extra blank line | ||
| $output->title('Fifth title'); |
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.
Sixth :)
chalasr commentedApr 9, 2018
Thank you@ogizanagi. |
…eln (ogizanagi)This PR was merged into the 4.1-dev branch.Discussion----------[Console] Support iterable in SymfonyStyle::write/writeln| Q | A| ------------- | ---| Branch? | master <!-- see below -->| Bug fix? | no| New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | N/ARelates to#26847.This would enable iterables benefits even when using `SymfonyStyle` output.Commits-------d66827e [Console] Support iterable in SymfonyStyle::write/writeln
| // Preserve the last 4 chars inserted (PHP_EOL on windows is two chars) in the history buffer | ||
| returnarray_map(function ($value) { | ||
| returnsubstr($value, -4); | ||
| },array_merge(array($this->bufferedOutput->fetch()), (array)$messages)); |
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 thefetch part was useless all along?
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.
It wasn't useless, but as we now only handle strings one by one and are writing to the buffer directly (instead of concatenating arrays of buffered output), it is not required anymore.
Tobion commentedApr 9, 2018
Nice change@ogizanagi . Thanks |
Relates to#26847.
This would enable iterables benefits even when using
SymfonyStyleoutput.