SymfonyComponentConsoleFormatterOutputFormatter

Formatter class for console output.

Summary

No protected methods found
No protected properties found
N/A
File
vendorSymfonyComponentConsoleFormatterOutputFormatter.php
Package
Default
Class hierarchy
SymfonyComponentConsoleFormatterOutputFormatter
Implements
SymfonyComponentConsoleFormatterOutputFormatterInterface

Tags

author

Konstantin Kudryashov ever.zet@gmail.com

api

Constants

FORMAT_PATTERN

FORMAT_PATTERN

The pattern to phrase the format.

Tags

None found

Properties

$decorated

$decorated : 

Type

Tags

None found

$styles

$styles : 

Type

Tags

None found

Methods

__construct()

__construct(Boolean  $decorated = null, array  $styles = array()) 

Initializes console output formatter.

Parameters

Boolean $decorated

Whether this formatter should actually decorate strings

array $styles

Array of "name => FormatterStyle" instances

Tags

api

setDecorated()

setDecorated(Boolean  $decorated) 

Sets the decorated flag.

Parameters

Boolean $decorated

Whether to decorate the messages or not

Tags

api

isDecorated()

isDecorated() : Boolean

Gets the decorated flag.

Returns

Boolean —

true if the output will decorate messages, false otherwise

Tags

api

setStyle()

setStyle(string  $name, \Symfony\Component\Console\Formatter\OutputFormatterStyleInterface  $style) 

Sets a new style.

Parameters

string $name

The style name

SymfonyComponentConsoleFormatterOutputFormatterStyleInterface $style

The style instance

Tags

api

hasStyle()

hasStyle(string  $name) : Boolean

Checks if output formatter has style with specified name.

Parameters

string $name

Returns

Boolean

Tags

api

getStyle()

getStyle(string  $name) : \Symfony\Component\Console\Formatter\OutputFormatterStyleInterface

Gets style options from style with specified name.

Parameters

string $name

Throws

InvalidArgumentException

When style isn't defined

Returns

SymfonyComponentConsoleFormatterOutputFormatterStyleInterface

Tags

api

format()

format(string  $message) : string

Formats a message according to the given styles.

Parameters

string $message

The message to style

Returns

string —

The styled message

Tags

api

replaceStyle()

replaceStyle(array  $match) : string

Replaces style of the output.

Parameters

array $match

Returns

string —

The replaced style

Tags

None found

createStyleFromString()

createStyleFromString(string  $string) : \Symfony\Component\Console\Formatter\Symfony\Component\Console\Format\FormatterStyle|Boolean

Tries to create new style instance from string.

Parameters

string $string

Returns

SymfonyComponentConsoleFormatterSymfonyComponentConsoleFormatFormatterStyle|Boolean —

false if string is not format string

Tags

None found