Formatter class for console output.
- author Konstantin Kudryashov
- author Roland Franssen
CloneableInstantiable
| Methods |
| public __clone() |
| public __construct(bool $decorated = false, array $styles = []) Initializes console output formatter.
|
| public static escape(string $text) : string Escapes "<" and ">" special chars in given text. |
| public static escapeTrailingBackslash(string $text) : string Escapes trailing "" in given text.
|
| public format(?string $message) : ?string |
| public formatAndWrap(?string $message, int $width) : string |
| public getStyle(string $name) : Symfony |
| public getStyleStack() : Symfony |
| public hasStyle(string $name) : bool |
| public isDecorated() : bool |
| public setDecorated(bool $decorated) : void |
| public setStyle(string $name, Symfony |
| Properties |
| private bool $decorated |
| private array $styles = [] |
| private Symfony |
| Methods |
| private addLineBreaks(string $text, int $width) : string |
| private applyCurrentStyle(string $text, string $current, int $width, int $currentLineLength) : string Applies current style from stack to text, if must be applied. |
| private createStyleFromString(string $string) : ?Symfony Tries to create new style instance from string. |
| Methods |
| public static escape(string $text) : string Escapes "<" and ">" special chars in given text. |
| public static escapeTrailingBackslash(string $text) : string Escapes trailing "" in given text.
|