Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9e74afd

Browse files
committed
bug #53537 [VarDumper] Fix missing colors initialization in CliDumper (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [VarDumper] Fix missing colors initialization in `CliDumper` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | - | License | MIT Backporting #53521 to 5.4 Commits ------- 6817109 [VarDumper] Fix missing colors initialization in CliDumper
2 parents 840c5cc + 6817109 commit 9e74afd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/VarDumper/Dumper/CliDumper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,10 @@ protected function supportsColors()
564564
*/
565565
protected function dumpLine(int $depth, bool $endOfValue = false)
566566
{
567+
if (null === $this->colors) {
568+
$this->colors = $this->supportsColors();
569+
}
570+
567571
if ($this->colors) {
568572
$this->line = sprintf("\033[%sm%s\033[m", $this->styles['default'], $this->line);
569573
}

0 commit comments

Comments
 (0)