Webmozart\Console\Api\Config\ApplicationConfig::addStyles PHP 메소드

addStyles() 공개 메소드

Adds multiple styles to the style set.
또한 보기: StyleSet::merge()
public addStyles ( array $styles ) : static
$styles array The styles to add.
리턴 static The current instance.
    public function addStyles(array $styles)
    {
        if (!$this->styleSet) {
            $this->styleSet = new DefaultStyleSet();
        }
        $this->styleSet->merge($styles);
        return $this;
    }

Usage Example

예제 #1
0
 public function testRemoveStyle()
 {
     $style1 = Style::tag('custom1');
     $style2 = Style::tag('custom2');
     $this->config->addStyles(array($style1, $style2));
     $this->config->removeStyle('custom1');
     $styleSet = new DefaultStyleSet();
     $styleSet->add($style2);
     $this->assertEquals($styleSet, $this->config->getStyleSet());
 }