original_string: private static function hasColorSupport()
      {
          if (!\defined('STDOUT')) {
              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);
  
          // Check if formatted mode is S_IFCHR
          return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
      }
code: private static function hasColorSupport()
      {
          if (!\defined('STDOUT')) {
              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);
  
          // Check if formatted mode is S_IFCHR
          return $stat ? 0020000 === ($stat['mode'] & 0170000) : false;
      }
code_tokens: private static function hasColorSupport ( ) { if ( ! \ defined ( 'STDOUT' ) ) { 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 ) ; // Check if formatted mode is S_IFCHR return $ stat ? 0020000 === ( $ stat [ 'mode' ] & 0170000 ) : false ; }
docstring: Returns true if STDOUT is defined and supports colorization.
  
  Reference: Composer\XdebugHandler\Process::supportsColor
  https://github.com/composer/xdebug-handler
  
  @return bool
docstring_tokens: Returns true if STDOUT is defined and supports colorization .