Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Inheritance: extends Webmozart\Console\Api\Formatter\StyleSet
Esempio n. 1
0
 /**
  * Creates the formatter.
  *
  * @param StyleSet $styleSet The style set to use.
  */
 public function __construct(StyleSet $styleSet = null)
 {
     $this->innerFormatter = new OutputFormatter(false);
     if (!$styleSet) {
         $styleSet = new DefaultStyleSet();
     }
     foreach ($styleSet->toArray() as $tag => $style) {
         $this->innerFormatter->setStyle($tag, StyleConverter::convert($style));
     }
 }
 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());
 }