Skip to content

Commit ed42358

Browse files
serious-angelnicolas-grekas
authored andcommitted
[PhpUnitBridge][Console][VarDumper] Add support for FORCE_COLOR environment variable
1 parent 5b396e1 commit ed42358

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: DeprecationErrorHandler.php

+5
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,11 @@ private static function hasColorSupport(): bool
411411
return false;
412412
}
413413

414+
// Follow https://force-color.org/
415+
if ('' !== (($_SERVER['FORCE_COLOR'] ?? getenv('FORCE_COLOR'))[0] ?? '')) {
416+
return true;
417+
}
418+
414419
// Detect msysgit/mingw and assume this is a tty because detection
415420
// does not work correctly, see https://github.com/composer/composer/issues/9690
416421
if (!@stream_isatty(\STDOUT) && !\in_array(strtoupper((string) getenv('MSYSTEM')), ['MINGW32', 'MINGW64'], true)) {

0 commit comments

Comments
 (0)