public function write(string $text, bool $eol = false): self
    {
        list($method, $this->method) = [$this->method ?: 'line', ''];

        $text  = $this->colorizer->{$method}($text, []);
        $error = \stripos($method, 'error') !== false;

        if ($eol) {
            $text .= \PHP_EOL;
        }

        return $this->doWrite($text, $error);
    }
public function write(string $text, bool $eol = false): self
    {
        list($method, $this->method) = [$this->method ?: 'line', ''];

        $text  = $this->colorizer->{$method}($text, []);
        $error = \stripos($method, 'error') !== false;

        if ($eol) {
            $text .= \PHP_EOL;
        }

        return $this->doWrite($text, $error);
    }
public function write ( string $ text , bool $ eol = false ) : self { list ( $ method , $ this -> method ) = [ $ this -> method ? : 'line' , '' ] ; $ text = $ this -> colorizer -> { $ method } ( $ text , [ ] ) ; $ error = \ stripos ( $ method , 'error' ) !== false ; if ( $ eol ) { $ text .= \ PHP_EOL ; } return $ this -> doWrite ( $ text , $ error ) ; }
Write the formatted text to stdout or stderr.

@param string $text
@param bool   $eol

@return self
Write the formatted text to stdout or stderr .