8000 bug #44915 [Console] Fix compact table style to avoid outputting a le… · symfony/symfony@c1aa7b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit c1aa7b5

Browse files
committed
bug #44915 [Console] Fix compact table style to avoid outputting a leading space (Seldaek)
This PR was merged into the 4.4 branch. Discussion ---------- [Console] Fix compact table style to avoid outputting a leading space | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> This changes the `compact` output from: ``` a b \n foo bar \n ``` To: ``` a b \n foo bar \n ``` Note the only difference is the leading space which is not there anymore. IMO this is a much better default, but I do understand it changes something which has been as it is for ages, which may be considered a BC break more than a bugfix. Commits ------- 5ffedf5 [Console] Fix compact table style to avoid outputting a leading space
2 parents f1f123b + 5ffedf5 commit c1aa7b5

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -804,9 +804,9 @@ private static function initStyles(): array
804804
$compact = new TableStyle();
805805
$compact
806806
->setHorizontalBorderChars('')
807-
->setVerticalBorderChars(' ')
807+
->setVerticalBorderChars('')
808808
->setDefaultCrossingChar('')
809-
->setCellRowContentFormat('%s')
809+
->setCellRowContentFormat('%s ')
810810
;
811811

812812
$styleGuide = new TableStyle();

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ public function renderProvider()
118118
$books,
119119
'compact',
120120
<<<'TABLE'
121-
ISBN Title Author
122-
99921-58-10-7 Divine Comedy Dante Alighieri
123-
9971-5-0210-0 A Tale of Two Cities Charles Dickens
124-
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
125-
80-902734-1-6 And Then There Were None Agatha Christie
121+
ISBN Title Author
122+
99921-58-10-7 Divine Comedy Dante Alighieri
123+
9971-5-0210-0 A Tale of Two Cities Charles Dickens
124+
960-425-059-0 The Lord of the Rings J. R. R. Tolkien
125+
80-902734-1-6 And Then There Were None Agatha Christie
126126

127127
TABLE
128128
],

0 commit comments

Comments
 (0)
0