src/Symfony/Bridge/PhpUnit/DeprecationErrorHandler.php
/**
     * Returns true if STDOUT is defined and supports colorization.
     *
     * Reference: Composer\XdebugHandler\Process::supportsColor
     * https://github.com/composer/xdebug-handler
     *
     * @return bool
     */
Returns true if STDOUT is defined and supports colorization.

@return bool
Returns true if STDOUT is defined and supports colorization . @return bool
private static function hasColorSupport()
    {
        if (!\defined('STDOUT')) {
            return false;
        }
        if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) {
            return false;
        }
        if ('Hyper' === getenv('TERM_PROGRAM')) {
            return true;
        }
        if (\DIRECTORY_SEPARATOR === '\\') {
            return (\function_exists('sapi_windows_vt100_support')
                && sapi_windows_vt100_support(\STDOUT))
                || false !== getenv('ANSICON')
                || 'ON' === getenv('ConEmuANSI')
                || 'xterm' === getenv('TERM');
        }
        if (\function_exists('stream_isatty')) {
            return stream_isatty(\STDOUT);
        }
        if (\function_exists('posix_isatty')) {
            return posix_isatty(\STDOUT);
        }
        $stat = fstat(\STDOUT);
        return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
    }
private static function hasColorSupport ( ) { if ( ! \ defined ( 'STDOUT' ) ) { return false ; } if ( isset ( $ _SERVER [ 'NO_COLOR' ] ) || false !== getenv ( 'NO_COLOR' ) ) { return false ; } if ( 'Hyper' === getenv ( 'TERM_PROGRAM' ) ) { return true ; } if ( \ DIRECTORY_SEPARATOR === '\\' ) { return ( \ function_exists ( 'sapi_windows_vt100_support' ) && sapi_windows_vt100_support ( \ STDOUT ) ) || false !== getenv ( 'ANSICON' ) || 'ON' === getenv ( 'ConEmuANSI' ) || 'xterm' === getenv ( 'TERM' ) ; } if ( \ function_exists ( 'stream_isatty' ) ) { return stream_isatty ( \ STDOUT ) ; } if ( \ function_exists ( 'posix_isatty' ) ) { return posix_isatty ( \ STDOUT ) ; } $ stat = fstat ( \ STDOUT ) ; return $ stat ? 0020000 === ( $ stat [ 'mode' ] & 0170000 ) : false ; }
Returns true if STDOUT is defined and supports colorization.
Returns true if STDOUT is defined and supports colorization .
// Follow https://no-color.org/ // Check if formatted mode is S_IFCHR