Class StyleSet
A set of styles used by the formatter.
Methods summary
public
|
#
__construct( array $styles = array() )
Creates a new style set.
Parameters
- $styles
- The styles to add.
|
public
|
|
public
|
#
merge( array $styles )
Adds styles to the style set.
Adds styles to the style set.
Existing styles are preserved.
Parameters
- $styles
- The styles to add.
|
public
|
#
replace( array $styles )
Sets the styles of the style set.
Sets the styles of the style set.
Existing styles are removed.
Parameters
- $styles
- The styles to set.
|
public
|
#
remove( string $tag )
Removes a style.
This method does nothing if the tag does not exist.
Parameters
- $tag
- The tag of the style.
|
public
|
#
clear( )
Clears the contents of the style set.
Clears the contents of the style set.
|
public
boolean
|
#
contains( string $tag )
Returns whether the style with the given tag exists.
Returns whether the style with the given tag exists.
Parameters
- $tag
- The tag of the style.
Returns
boolean Returns true if a style with the given tag exists and
false otherwise.
|
public
boolean
|
#
isEmpty( )
Returns whether the style set is empty.
Returns whether the style set is empty.
Returns
boolean Returns true if the set contains no styles and false
otherwise.
|
public
Webmozart\Console\Api\Formatter\Style
|
#
get( string $tag )
Returns the style with the given tag.
Returns the style with the given tag.
Parameters
- $tag
- The tag of the style.
Returns
Throws
OutOfBoundsException If no style is set for the given tag.
|
public
Webmozart\Console\Api\Formatter\Style[]
|
#
toArray( )
Returns all styles.
Returns
|