Colors\Color::apply PHP Method

apply() public method

public apply ( $style, $text = null )
    public function apply($style, $text = null)
    {
        if ($text === null) {
            $this->wrapped = $this->stylize($style, $this->wrapped);
            return $this;
        }
        return $this->stylize($style, $text);
    }

Usage Example

コード例 #1
0
 public function error()
 {
     if ($this->color) {
         $this->writer->write($this->color->apply('bg_red', 'X'));
         $this->progress();
     } else {
         parent::error();
     }
 }
All Usage Examples Of Colors\Color::apply