protected function apply(string $text, bool $decorated) : string
    {
        return $decorated && !empty($text) ? $this->stack->current()->apply($text) : $text;
    }
protected function apply(string $text, bool $decorated) : string
    {
        return $decorated && !empty($text) ? $this->stack->current()->apply($text) : $text;
    }
protected function apply ( string $ text , bool $ decorated ) : string { return $ decorated && ! empty ( $ text ) ? $ this -> stack -> current ( ) -> apply ( $ text ) : $ text ; }
Applies formatting to the given text.

@param   string  $text       The text that should be formatted.
@param   bool    $decorated  Whether decorations, like colors, should be applied to the text.
@return  string              The resulting text.
Applies formatting to the given text .