Symfony\Component\Console\Formatter\OutputFormatter::setStyle PHP Метод

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

Sets a new style.
public setStyle ( string $name, Symfony\Component\Console\Formatter\OutputFormatterStyleInterface $style )
$name string The style name
$style Symfony\Component\Console\Formatter\OutputFormatterStyleInterface The style instance
    public function setStyle($name, OutputFormatterStyleInterface $style)
    {
        $this->styles[strtolower($name)] = $style;
    }

Usage Example

Пример #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));
     }
 }
All Usage Examples Of Symfony\Component\Console\Formatter\OutputFormatter::setStyle