Style.php
public function get()
    {
        if ($this->argument instanceof Argument && ! $this->argument->has('color')) {
            return $this->text;
        }

        $text = '';
        if ($this->foregroundColor !== '') {

            //~ Highlight
            $highlight = $this->hasHighlightedForeground ? static::HIGH_FOREGROUND : static::REGULAR_FOREGROUND;

            //~ Decoration
            $decoration = $this->isBold ? static::DECORATION_BOLD : '';
            $decoration .= $this->isUnderline ? static::DECORATION_UNDERLINE : '';
            $decoration = ! empty($decoration) ? $decoration : static::DECORATION_NONE;

            //~ Apply style
            $text .= self::BEGIN . $decoration . $highlight . $this->foregroundColor . self::END;
        }

        if ($this->backgroundColor !== '') {
            $highlight = $this->hasHighlightedBackground ? static::HIGH_BACKGROUND : static::REGULAR_BACKGROUND;
            $text .= self::BEGIN . $highlight . $this->backgroundColor . self::END;
        }

        $text .= $this->text . self::DESACTIVATE;

        return $text;
    }
public function get()
    {
        if ($this->argument instanceof Argument && ! $this->argument->has('color')) {
            return $this->text;
        }

        $text = '';
        if ($this->foregroundColor !== '') {

            //~ Highlight
            $highlight = $this->hasHighlightedForeground ? static::HIGH_FOREGROUND : static::REGULAR_FOREGROUND;

            //~ Decoration
            $decoration = $this->isBold ? static::DECORATION_BOLD : '';
            $decoration .= $this->isUnderline ? static::DECORATION_UNDERLINE : '';
            $decoration = ! empty($decoration) ? $decoration : static::DECORATION_NONE;

            //~ Apply style
            $text .= self::BEGIN . $decoration . $highlight . $this->foregroundColor . self::END;
        }

        if ($this->backgroundColor !== '') {
            $highlight = $this->hasHighlightedBackground ? static::HIGH_BACKGROUND : static::REGULAR_BACKGROUND;
            $text .= self::BEGIN . $highlight . $this->backgroundColor . self::END;
        }

        $text .= $this->text . self::DESACTIVATE;

        return $text;
    }
public function get ( ) { if ( $ this -> argument instanceof Argument && ! $ this -> argument -> has ( 'color' ) ) { return $ this -> text ; } $ text = '' ; if ( $ this -> foregroundColor !== '' ) { //~ Highlight $ highlight = $ this -> hasHighlightedForeground ? static :: HIGH_FOREGROUND : static :: REGULAR_FOREGROUND ; //~ Decoration $ decoration = $ this -> isBold ? static :: DECORATION_BOLD : '' ; $ decoration .= $ this -> isUnderline ? static :: DECORATION_UNDERLINE : '' ; $ decoration = ! empty ( $ decoration ) ? $ decoration : static :: DECORATION_NONE ; //~ Apply style $ text .= self :: BEGIN . $ decoration . $ highlight . $ this -> foregroundColor . self :: END ; } if ( $ this -> backgroundColor !== '' ) { $ highlight = $ this -> hasHighlightedBackground ? static :: HIGH_BACKGROUND : static :: REGULAR_BACKGROUND ; $ text .= self :: BEGIN . $ highlight . $ this -> backgroundColor . self :: END ; } $ text .= $ this -> text . self :: DESACTIVATE ; return $ text ; }
Get text with styles.

@return string
Get text with styles .