PHP Class Webmozart\Console\Api\Formatter\Style

Since: 1.0
Author: Bernhard Schussek ([email protected])
Mostra file Open project: webmozart/console Class Usage Examples

Public Methods

Method Description
__construct ( string $tag = null ) Creates a style.
bg ( string $color ) : static Sets the background color.
bgBlack ( ) : static Sets the background color to black.
bgBlue ( ) : static Sets the background color to blue.
bgCyan ( ) : static Sets the background color to cyan.
bgDefault ( ) : static Resets the background color to the system's default.
bgGreen ( ) : static Sets the background color to green.
bgMagenta ( ) : static Sets the background color to magenta.
bgRed ( ) : static Sets the background color to red.
bgWhite ( ) : static Sets the background color to white.
bgYellow ( ) : static Sets the background color to yellow.
blinking ( ) : static Enables blinking.
bold ( ) : static Sets the font weight to bold.
fg ( string $color ) : static Sets the foreground color.
fgBlack ( ) : static Sets the foreground color to black.
fgBlue ( ) : static Sets the foreground color to blue.
fgCyan ( ) : static Sets the foreground color to cyan.
fgDefault ( ) : static Resets the foreground color to the system's default.
fgGreen ( ) : static Sets the foreground color to green.
fgMagenta ( ) : static Sets the foreground color to magenta.
fgRed ( ) : static Sets the foreground color to red.
fgWhite ( ) : static Sets the foreground color to white.
fgYellow ( ) : static Sets the foreground color to yellow.
getBackgroundColor ( ) : string Returns the background color.
getForegroundColor ( ) : string Returns the foreground color.
getTag ( ) : string Returns the style's tag name.
hidden ( ) : static Hides the text.
inverse ( ) : static Enables inverse colors.
isBlinking ( ) : boolean Returns whether the text is blinking.
isBold ( ) : boolean Returns whether the text is bold.
isHidden ( ) : boolean Returns whether the text is concealed.
isInverse ( ) : boolean Returns whether the text is reversed.
isUnderlined ( ) : boolean Returns whether the text is underlined.
noTag ( ) : static Creates a style without a tag name.
notBlinking ( ) : static Disables blinking.
notBold ( ) : static Sets the font weight to normal.
notHidden ( ) : static Does not hide the text.
notInverse ( ) : static Disables inverse colors.
notUnderlined ( ) : static Disables underlining.
tag ( string $tag ) : static Creates a style with the given tag name.
underlined ( ) : static Enables underlining.

Method Details

__construct() public method

Creates a style.
public __construct ( string $tag = null )
$tag string The tag name.

bg() public method

Sets the background color.
public bg ( string $color ) : static
$color string One of the color constants.
return static The current instance.

bgBlack() public method

Sets the background color to black.
public bgBlack ( ) : static
return static The current instance.

bgBlue() public method

Sets the background color to blue.
public bgBlue ( ) : static
return static The current instance.

bgCyan() public method

Sets the background color to cyan.
public bgCyan ( ) : static
return static The current instance.

bgDefault() public method

Resets the background color to the system's default.
public bgDefault ( ) : static
return static The current instance.

bgGreen() public method

Sets the background color to green.
public bgGreen ( ) : static
return static The current instance.

bgMagenta() public method

Sets the background color to magenta.
public bgMagenta ( ) : static
return static The current instance.

bgRed() public method

Sets the background color to red.
public bgRed ( ) : static
return static The current instance.

bgWhite() public method

Sets the background color to white.
public bgWhite ( ) : static
return static The current instance.

bgYellow() public method

Sets the background color to yellow.
public bgYellow ( ) : static
return static The current instance.

blinking() public method

Enables blinking.
public blinking ( ) : static
return static The current instance.

bold() public method

Sets the font weight to bold.
public bold ( ) : static
return static The current instance.

fg() public method

Sets the foreground color.
public fg ( string $color ) : static
$color string One of the color constants.
return static The current instance.

fgBlack() public method

Sets the foreground color to black.
public fgBlack ( ) : static
return static The current instance.

fgBlue() public method

Sets the foreground color to blue.
public fgBlue ( ) : static
return static The current instance.

fgCyan() public method

Sets the foreground color to cyan.
public fgCyan ( ) : static
return static The current instance.

fgDefault() public method

Resets the foreground color to the system's default.
public fgDefault ( ) : static
return static The current instance.

fgGreen() public method

Sets the foreground color to green.
public fgGreen ( ) : static
return static The current instance.

fgMagenta() public method

Sets the foreground color to magenta.
public fgMagenta ( ) : static
return static The current instance.

fgRed() public method

Sets the foreground color to red.
public fgRed ( ) : static
return static The current instance.

fgWhite() public method

Sets the foreground color to white.
public fgWhite ( ) : static
return static The current instance.

fgYellow() public method

Sets the foreground color to yellow.
public fgYellow ( ) : static
return static The current instance.

getBackgroundColor() public method

Returns the background color.
public getBackgroundColor ( ) : string
return string One of the color constants or `null` if the system's default should be used.

getForegroundColor() public method

Returns the foreground color.
public getForegroundColor ( ) : string
return string One of the color constants or `null` if the system's default should be used.

getTag() public method

Returns the style's tag name.
public getTag ( ) : string
return string The tag name or `null` if the style has no tag.

hidden() public method

Hides the text.
public hidden ( ) : static
return static The current instance.

inverse() public method

Enables inverse colors.
public inverse ( ) : static
return static The current instance.

isBlinking() public method

Returns whether the text is blinking.
public isBlinking ( ) : boolean
return boolean Returns `true` if text is formatted blinking and `false` otherwise.

isBold() public method

Returns whether the text is bold.
public isBold ( ) : boolean
return boolean Returns `true` if text is formatted bold and `false` otherwise.

isHidden() public method

Returns whether the text is concealed.
public isHidden ( ) : boolean
return boolean Returns `true` if text is formatted concealed and `false` otherwise.

isInverse() public method

Returns whether the text is reversed.
public isInverse ( ) : boolean
return boolean Returns `true` if text is formatted reversed and `false` otherwise.

isUnderlined() public method

Returns whether the text is underlined.
public isUnderlined ( ) : boolean
return boolean Returns `true` if text is formatted underlined and `false` otherwise.

noTag() public static method

Creates a style without a tag name.
See also: tag()
public static noTag ( ) : static
return static The created style.

notBlinking() public method

Disables blinking.
public notBlinking ( ) : static
return static The current instance.

notBold() public method

Sets the font weight to normal.
public notBold ( ) : static
return static The current instance.

notHidden() public method

Does not hide the text.
public notHidden ( ) : static
return static The current instance.

notInverse() public method

Disables inverse colors.
public notInverse ( ) : static
return static The current instance.

notUnderlined() public method

Disables underlining.
public notUnderlined ( ) : static
return static The current instance.

tag() public static method

Creates a style with the given tag name.
See also: noTag()
public static tag ( string $tag ) : static
$tag string The tag name.
return static The created style.

underlined() public method

Enables underlining.
public underlined ( ) : static
return static The current instance.