class OutputFormatter implements OutputFormatterInterface
Formatter class for console output.
static string | escape(string $text) Escapes "<" special char in given text. | |
static string | escapeTrailingBackslash(string $text) Escapes trailing "\" in given text. | |
__construct(bool $decorated = false, array $styles = array()) Initializes console output formatter. | ||
setDecorated(bool $decorated) Sets the decorated flag. | ||
bool | isDecorated() Gets the decorated flag. | |
setStyle(string $name, OutputFormatterStyleInterface $style) Sets a new style. | ||
bool | hasStyle(string $name) Checks if output formatter has style with specified name. | |
OutputFormatterStyleInterface | getStyle(string $name) Gets style options from style with specified name. | |
string | format(string $message) Formats a message according to the given styles. | |
OutputFormatterStyleStack | getStyleStack() |
Escapes "<" special char in given text.
string | $text | Text to escape |
string | Escaped text |
Escapes trailing "\" in given text.
string | $text | Text to escape |
string | Escaped text |
Initializes console output formatter.
bool | $decorated | Whether this formatter should actually decorate strings |
array | $styles | Array of "name => FormatterStyle" instances |
Sets the decorated flag.
bool | $decorated | Whether to decorate the messages or not |
Gets the decorated flag.
bool | true if the output will decorate messages, false otherwise |
Sets a new style.
string | $name | The style name |
OutputFormatterStyleInterface | $style | The style instance |
Checks if output formatter has style with specified name.
string | $name |
bool |
Gets style options from style with specified name.
string | $name |
OutputFormatterStyleInterface |
InvalidArgumentException | When style isn't defined |
Formats a message according to the given styles.
string | $message | The message to style |
string | The styled message |
OutputFormatterStyleStack |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Console/Formatter/OutputFormatter.html