Skip to content

Commit d9fae25

Browse files
committed
[Console] Fix for block() padding formatting after symfony#19189
1 parent e0f1476 commit d9fae25

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,16 @@ private function createBlock($messages, $type = null, $style = null, $prefix = '
410410
}
411411
}
412412

413+
$firstLineIndex = 0;
414+
if ($padding && $this->isDecorated()) {
415+
$firstLineIndex = 1;
416+
array_unshift($lines, '');
417+
$lines[] = '';
418+
}
419+
413420
foreach ($lines as $i => &$line) {
414421
if (null !== $type) {
415-
$line = 0 === $i ? $type.$line : $lineIndentation.$line;
422+
$line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line;
416423
}
417424

418425
$line = $prefix.$line;
@@ -423,11 +430,6 @@ private function createBlock($messages, $type = null, $style = null, $prefix = '
423430
}
424431
}
425432

426-
if ($padding && $this->isDecorated()) {
427-
array_unshift($lines, '');
428-
$lines[] = '';
429-
}
430-
431433
return $lines;
432434
}
433435
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy