Webmozart\Console\Api\Config\ApplicationConfig::addStyle PHP Метод

addStyle() публичный Метод

Adds a style to the style set.
См. также: StyleSet::add()
public addStyle ( Style $style ) : static
$style Webmozart\Console\Api\Formatter\Style The style to add.
Результат static The current instance.
    public function addStyle(Style $style)
    {
        if (!$this->styleSet) {
            $this->styleSet = new DefaultStyleSet();
        }
        $this->styleSet->add($style);
        return $this;
    }

Usage Example

Пример #1
0
 public function testAddStyle()
 {
     $style = Style::tag('custom');
     $this->config->addStyle($style);
     $styleSet = new DefaultStyleSet();
     $styleSet->add($style);
     $this->assertEquals($styleSet, $this->config->getStyleSet());
 }