Symfony\Component\Console\Formatter\OutputFormatter
Formatter class for console output.
- Author: Konstantin Kudryashov <ever.zet@gmail.com>
Synopsis
class OutputFormatter
implements
OutputFormatterInterface
{
- // constants
- const FORMAT_PATTERN = '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)#isx';
- // members
- private $decorated;
- private array $styles;
- private $styleStack;
- // methods
- public static string escape()
- public void __construct()
- public void setDecorated()
- public Boolean isDecorated()
- public void setStyle()
- public Boolean hasStyle()
- public OutputFormatterStyleInterface getStyle()
- public string format()
- public OutputFormatterStyleStack getStyleStack()
- private string replaceStyle()
- private OutputFormatterStyle|Boolean createStyleFromString()
- private string applyCurrentStyle()
Hierarchy
Constants
Name | Value |
---|---|
FORMAT_PATTERN | '#(\\\\?)<(/?)([a-z][a-z0-9_=;-]+)?>((?: [^<\\\\]+ | (?!<(?:/?[a-z]|/>)). | .(?<=\\\\<) )*)#isx' |
Members
private
- $decorated
- $styleStack
- $styles
Methods
private
- applyCurrentStyle() — Applies current style from stack to text, if must be applied.
- createStyleFromString() — Tries to create new style instance from string.
- replaceStyle() — Replaces style of the output.
public
- __construct() — Initializes console output formatter.
- escape() — Escapes "<" special char in given text.
- format() — Formats a message according to the given styles.
- getStyle() — Gets style options from style with specified name.
- getStyleStack()
- hasStyle() — Checks if output formatter has style with specified name.
- isDecorated() — Gets the decorated flag.
- setDecorated() — Sets the decorated flag.
- setStyle() — Sets a new style.