ConsoleKit\Command::format PHP Method

format() public method

Formats text using a {@see TextFormater}
public format ( string $text, integer | array $formatOptions = [] ) : string
$text string
$formatOptions integer | array Either an array of options for TextFormater or a color code
return string
    public function format($text, $formatOptions = array())
    {
        if (!is_array($formatOptions)) {
            $formatOptions = array('fgcolor' => $formatOptions);
        }
        $formatOptions = array_merge($this->defaultFormatOptions, $formatOptions);
        $formater = new TextFormater($formatOptions);
        return $formater->format($text);
    }