protected function formatMessage($message, $format = [Console::FG_RED, Console::BOLD])
    {
        $stream = (PHP_SAPI === 'cli') ? \STDERR : \STDOUT;
        // try controller first to allow check for --color switch
        if ($this->app->controller instanceof Controller && $this->app->controller->isColorEnabled($stream)
            || $this->app instanceof Application && Console::streamSupportsAnsiColors($stream)) {
            $message = Console::ansiFormat($message, $format);
        }

        return $message;
    }
protected function formatMessage($message, $format = [Console::FG_RED, Console::BOLD])
    {
        $stream = (PHP_SAPI === 'cli') ? \STDERR : \STDOUT;
        // try controller first to allow check for --color switch
        if ($this->app->controller instanceof Controller && $this->app->controller->isColorEnabled($stream)
            || $this->app instanceof Application && Console::streamSupportsAnsiColors($stream)) {
            $message = Console::ansiFormat($message, $format);
        }

        return $message;
    }
protected function formatMessage ( $ message , $ format = [ Console :: FG_RED , Console :: BOLD ] ) { $ stream = ( PHP_SAPI === 'cli' ) ? \ STDERR : \ STDOUT ; // try controller first to allow check for --color switch if ( $ this -> app -> controller instanceof Controller && $ this -> app -> controller -> isColorEnabled ( $ stream ) || $ this -> app instanceof Application && Console :: streamSupportsAnsiColors ( $ stream ) ) { $ message = Console :: ansiFormat ( $ message , $ format ) ; } return $ message ; }
Colorizes a message for console output.
@param string $message the message to colorize.
@param array $format the message format.
@return string the colorized message.
@see Console::ansiFormat() for details on how to specify the message format.
Colorizes a message for console output .