PHP Класс Symfony\Component\Console\Formatter\OutputFormatter

Автор: Konstantin Kudryashov ([email protected])
Наследование: implements Symfony\Component\Console\Formatter\OutputFormatterInterface
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( boolean $decorated = false, array $styles = [] ) Initializes console output formatter.
escape ( string $text ) : string Escapes "<" special char in given text.
escapeTrailingBackslash ( string $text ) : string Escapes trailing "\" in given text.
format ( string $message ) : string Formats a message according to the given styles.
getStyle ( string $name ) : Symfony\Component\Console\Formatter\OutputFormatterStyleInterface Gets style options from style with specified name.
getStyleStack ( ) : Symfony\Component\Console\Formatter\OutputFormatterStyleStack
hasStyle ( string $name ) : boolean Checks if output formatter has style with specified name.
isDecorated ( ) : boolean Gets the decorated flag.
setDecorated ( boolean $decorated ) Sets the decorated flag.
setStyle ( string $name, Symfony\Component\Console\Formatter\OutputFormatterStyleInterface $style ) Sets a new style.

Приватные методы

Метод Описание
applyCurrentStyle ( string $text ) : string Applies current style from stack to text, if must be applied.
createStyleFromString ( string $string ) : Symfony\Component\Console\Formatter\OutputFormatterStyle | boolean Tries to create new style instance from string.

Описание методов

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

Initializes console output formatter.
public __construct ( boolean $decorated = false, array $styles = [] )
$decorated boolean Whether this formatter should actually decorate strings
$styles array Array of "name => FormatterStyle" instances

escape() публичный статический Метод

Escapes "<" special char in given text.
public static escape ( string $text ) : string
$text string Text to escape
Результат string Escaped text

escapeTrailingBackslash() публичный статический Метод

Escapes trailing "\" in given text.
public static escapeTrailingBackslash ( string $text ) : string
$text string Text to escape
Результат string Escaped text

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

Formats a message according to the given styles.
public format ( string $message ) : string
$message string The message to style
Результат string The styled message

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

Gets style options from style with specified name.
public getStyle ( string $name ) : Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
$name string
Результат Symfony\Component\Console\Formatter\OutputFormatterStyleInterface

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

public getStyleStack ( ) : Symfony\Component\Console\Formatter\OutputFormatterStyleStack
Результат Symfony\Component\Console\Formatter\OutputFormatterStyleStack

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

Checks if output formatter has style with specified name.
public hasStyle ( string $name ) : boolean
$name string
Результат boolean

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

Gets the decorated flag.
public isDecorated ( ) : boolean
Результат boolean true if the output will decorate messages, false otherwise

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

Sets the decorated flag.
public setDecorated ( boolean $decorated )
$decorated boolean Whether to decorate the messages or not

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