TYPO3
7.6
|
Public Member Functions | |
__construct ($decorated=false, array $styles=array()) | |
setDecorated ($decorated) | |
isDecorated () | |
setStyle ($name, OutputFormatterStyleInterface $style) | |
hasStyle ($name) | |
getStyle ($name) | |
format ($message) | |
getStyleStack () | |
Static Public Member Functions | |
static | escape ($text) |
Private Member Functions | |
createStyleFromString ($string) | |
applyCurrentStyle ($text) | |
Private Attributes | |
$decorated | |
$styles = array() | |
$styleStack | |
Formatter class for console output.
Definition at line 21 of file OutputFormatter.php.
__construct | ( | $decorated = false , |
|
array | $styles = array() |
||
) |
Initializes console output formatter.
bool | $decorated | Whether this formatter should actually decorate strings |
OutputFormatterStyleInterface[] | $styles Array of "name => FormatterStyle" instances |
Definition at line 47 of file OutputFormatter.php.
References OutputFormatter\$decorated, OutputFormatter\$styles, and OutputFormatter\setStyle().
|
private |
Applies current style from stack to text, if must be applied.
string | $text | Input text |
Definition at line 238 of file OutputFormatter.php.
References OutputFormatter\isDecorated().
Referenced by OutputFormatter\format().
|
private |
Tries to create new style instance from string.
string | $string |
Definition at line 201 of file OutputFormatter.php.
References elseif.
Referenced by OutputFormatter\format().
|
static |
Escapes "<" special char in given text.
string | $text | Text to escape |
Definition at line 34 of file OutputFormatter.php.
Referenced by SymfonyStyle\block(), FormatterHelper\formatBlock(), and OutputFormatterTest\testLGCharEscaping().
format | ( | $message | ) |
Formats a message according to the given styles.
string | $message | The message to style |
Implements OutputFormatterInterface.
Definition at line 143 of file OutputFormatter.php.
References OutputFormatter\applyCurrentStyle(), OutputFormatter\createStyleFromString(), and elseif.
getStyle | ( | $name | ) |
Gets style options from style with specified name.
string | $name |
\InvalidArgumentException | When style isn't defined |
Implements OutputFormatterInterface.
Definition at line 125 of file OutputFormatter.php.
References OutputFormatter\hasStyle().
getStyleStack | ( | ) |
Definition at line 189 of file OutputFormatter.php.
References OutputFormatter\$styleStack.
hasStyle | ( | $name | ) |
Checks if output formatter has style with specified name.
string | $name |
Implements OutputFormatterInterface.
Definition at line 109 of file OutputFormatter.php.
Referenced by OutputFormatter\getStyle().
isDecorated | ( | ) |
Gets the decorated flag.
Implements OutputFormatterInterface.
Definition at line 82 of file OutputFormatter.php.
References OutputFormatter\$decorated.
Referenced by OutputFormatter\applyCurrentStyle().
setDecorated | ( | $decorated | ) |
Sets the decorated flag.
bool | $decorated | Whether to decorate the messages or not |
Implements OutputFormatterInterface.
Definition at line 70 of file OutputFormatter.php.
References OutputFormatter\$decorated.
setStyle | ( | $name, | |
OutputFormatterStyleInterface | $style | ||
) |
Sets a new style.
string | $name | The style name |
OutputFormatterStyleInterface | $style | The style instance |
Implements OutputFormatterInterface.
Definition at line 95 of file OutputFormatter.php.
Referenced by OutputFormatter\__construct().
|
private |
Definition at line 23 of file OutputFormatter.php.
Referenced by OutputFormatter\__construct(), OutputFormatter\isDecorated(), and OutputFormatter\setDecorated().
|
private |
Definition at line 24 of file OutputFormatter.php.
Referenced by OutputFormatter\__construct().
|
private |
Definition at line 25 of file OutputFormatter.php.
Referenced by OutputFormatter\getStyleStack().