SymfonyComponentConsoleFormatterOutputFormatterStyle

Formatter style class for defining styles.

Summary

No protected methods found
No protected properties found
N/A
File
vendorSymfonyComponentConsoleFormatterOutputFormatterStyle.php
Package
Default
Class hierarchy
SymfonyComponentConsoleFormatterOutputFormatterStyle
Implements
SymfonyComponentConsoleFormatterOutputFormatterStyleInterface

Tags

author

Konstantin Kudryashov ever.zet@gmail.com

api

Properties

$availableForegroundColors

$availableForegroundColors : 

Type

Tags

None found

$availableBackgroundColors

$availableBackgroundColors : 

Type

Tags

None found

$availableOptions

$availableOptions : 

Type

Tags

None found

$foreground

$foreground : 

Type

Tags

None found

$background

$background : 

Type

Tags

None found

$options

$options : 

Type

Tags

None found

Methods

__construct()

__construct(string  $foreground = null, string  $background = null, array  $options = array()) 

Initializes output formatter style.

Parameters

string $foreground

style foreground color name

string $background

style background color name

array $options

style options

Tags

api

setForeground()

setForeground(string  $color = null) 

Sets style foreground color.

Parameters

string $color

color name

Throws

InvalidArgumentException

When the color name isn't defined

Tags

api

setBackground()

setBackground(string  $color = null) 

Sets style background color.

Parameters

string $color

color name

Throws

InvalidArgumentException

When the color name isn't defined

Tags

api

setOption()

setOption(string  $option) 

Sets some specific style option.

Parameters

string $option

option name

Throws

InvalidArgumentException

When the option name isn't defined

Tags

api

unsetOption()

unsetOption(string  $option) 

Unsets some specific style option.

Parameters

string $option

option name

Throws

InvalidArgumentException

When the option name isn't defined

Tags

None found

setOptions()

setOptions(array  $options) 

Sets multiple style options at once.

Parameters

array $options

Tags

None found

apply()

apply(string  $text) : string

Applies the style to a given text.

Parameters

string $text

The text to style

Returns

string

Tags

None found