Skip to content

Commit 4ae8384

Browse files
[PhpUnitBridge][Console][VarDumper] Fix handling NO_COLOR env var
1 parent 0ae7140 commit 4ae8384

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ private static function hasColorSupport()
410410
}
411411

412412
// Follow https://no-color.org/
413-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
413+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
414414
return false;
415415
}
416416

src/Symfony/Component/Console/Output/StreamOutput.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ protected function doWrite(string $message, bool $newline)
9191
protected function hasColorSupport()
9292
{
9393
// Follow https://no-color.org/
94-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
94+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
9595
return false;
9696
}
9797

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ private function hasColorSupport($stream): bool
606606
}
607607

608608
// Follow https://no-color.org/
609-
if ('' !== ($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR') ?: '')) {
609+
if ('' !== (($_SERVER['NO_COLOR'] ?? getenv('NO_COLOR'))[0] ?? '')) {
610610
return false;
611611
}
612612

0 commit comments

Comments
 (0)