Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • OutputFormatter
  • OutputFormatterStyle
  • OutputFormatterStyleStack

Interfaces

  • OutputFormatterInterface
  • OutputFormatterStyleInterface
  • Overview
  • Namespace
  • Class

Class OutputFormatterStyle

Formatter style class for defining styles.

Symfony\Component\Console\Formatter\OutputFormatterStyle implements Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
Namespace: Symfony\Component\Console\Formatter
Author: Konstantin Kudryashov ever.zet@gmail.com
Located at Formatter/OutputFormatterStyle.php
Methods summary
public
# __construct( string|null $foreground = null, string|null $background = null, array $options = array() )

Initializes output formatter style.

Initializes output formatter style.

Parameters

$foreground
The style foreground color name
$background
The style background color name
$options
The style options
public
# setForeground( string|null $color = null )

Sets style foreground color.

Sets style foreground color.

Parameters

$color
The color name

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When the color name isn't defined

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::setForeground()
public
# setBackground( string|null $color = null )

Sets style background color.

Sets style background color.

Parameters

$color
The color name

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When the color name isn't defined

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::setBackground()
public
# setOption( string $option )

Sets some specific style option.

Sets some specific style option.

Parameters

$option
The option name

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When the option name isn't defined

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::setOption()
public
# unsetOption( string $option )

Unsets some specific style option.

Unsets some specific style option.

Parameters

$option
The option name

Throws

Symfony\Component\Console\Exception\InvalidArgumentException
When the option name isn't defined

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::unsetOption()
public
# setOptions( array $options )

Sets multiple style options at once.

Sets multiple style options at once.

Parameters

$options

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::setOptions()
public string
# apply( string $text )

Applies the style to a given text.

Applies the style to a given text.

Parameters

$text
The text to style

Returns

string

Implementation of

Symfony\Component\Console\Formatter\OutputFormatterStyleInterface::apply()
Peridot API documentation generated by ApiGen