OutputFormatterStyle::setOption()

setOption(string $option) Sets some specific style option. Parameters string $option The option name Exceptions InvalidArgumentException When the option name isn't defined

OutputFormatterStyle::setForeground()

setForeground(string $color = null) Sets style foreground color. Parameters string $color The color name Exceptions InvalidArgumentException When the color name isn't defined

OutputFormatterStyle::setBackground()

setBackground(string $color = null) Sets style background color. Parameters string $color The color name Exceptions InvalidArgumentException When the color name isn't defined

OutputFormatterStyle::apply()

string apply(string $text) Applies the style to a given text. Parameters string $text The text to style Return Value string

OutputFormatterStyle

class OutputFormatterStyle implements OutputFormatterStyleInterface Formatter style class for defining styles. Methods __construct(string|null $foreground = null, string|null $background = null, array $options = array()) Initializes output formatter style. setForeground(string $color = null) Sets style foreground color. setBackground(string $color = null) Sets style background color. setOption(string $option) Sets some specific style option. unsetOption(string $option

OutputFormatterInterface::setStyle()

setStyle(string $name, OutputFormatterStyleInterface $style) Sets a new style. Parameters string $name The style name OutputFormatterStyleInterface $style The style instance

OutputFormatterInterface::setDecorated()

setDecorated(bool $decorated) Sets the decorated flag. Parameters bool $decorated Whether to decorate the messages or not

OutputFormatterInterface::isDecorated()

bool isDecorated() Gets the decorated flag. Return Value bool true if the output will decorate messages, false otherwise

OutputFormatterInterface::hasStyle()

bool hasStyle(string $name) Checks if output formatter has style with specified name. Parameters string $name Return Value bool

OutputFormatterInterface::getStyle()

OutputFormatterStyleInterface getStyle(string $name) Gets style options from style with specified name. Parameters string $name Return Value OutputFormatterStyleInterface