8000 Simplify. · symfony/symfony@ca1753b · GitHub
[go: up one dir, main page]

Skip to content

Commit ca1753b

Browse files
committed
Simplify.
1 parent 33199b2 commit ca1753b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Symfony/Component/Console/Style/SymfonyStyle.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,6 @@ private function createBlock(iterable $messages, string $type = null, string $st
466466
}
467467

468468
// wrap and add newlines for each element
469-
$messagesLines = [];
470469
foreach ($messages as $key => $message) {
471470
if ($escape) {
472471
$message = OutputFormatter::escape($message);
@@ -476,14 +475,13 @@ private function createBlock(iterable $messages, string $type = null, string $st
476475
$messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength);
477476
$messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true));
478477
foreach ($messageLines as $messageLine) {
479-
$messagesLines[] = $messageLine;
478+
$lines[] = $messageLine;
480479
}
481480

482481
if (\count($messages) > 1 && $key < \count($messages) - 1) {
483-
$messagesLines[] = '';
482+
$lines[] = '';
484483
}
485484
}
486-
$lines = array_merge($lines, $messagesLines);
487485

488486
$firstLineIndex = 0;
489487
if ($padding && $this->isDecorated()) {
@@ -495,7 +493,7 @@ private function createBlock(iterable $messages, string $type = null, string $st
495493
foreach ($lines as $i => &$line) {
496494
if (null !== $type) {
497495
$line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line;
498-
}
496+
}
499497

500498
$line = $prefix.$line;
501499
$decorationLength = Helper::strlen($line) - Helper::strlenWithoutDecoration($this->getFormatter(), $line);

0 commit comments

Comments
 (0)
0