OutputFormatter
    
            
            in package
            
        
    
            
            implements
                            WrappableOutputFormatterInterface                    
    
    
        
            Formatter class for console output.
Tags
Interfaces, Classes, Traits and Enums
- WrappableOutputFormatterInterface
 - Formatter interface for console output that supports word wrapping.
 
Table of Contents
- $decorated : mixed
 - $styles : mixed
 - $styleStack : mixed
 - __construct() : mixed
 - Initializes console output formatter.
 - escape() : string
 - Escapes "<" special char in given text.
 - format() : mixed
 - {@inheritdoc}
 - formatAndWrap() : mixed
 - Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
 - getStyle() : mixed
 - {@inheritdoc}
 - getStyleStack() : OutputFormatterStyleStack
 - hasStyle() : mixed
 - {@inheritdoc}
 - isDecorated() : mixed
 - {@inheritdoc}
 - setDecorated() : mixed
 - {@inheritdoc}
 - setStyle() : mixed
 - {@inheritdoc}
 - applyCurrentStyle() : string
 - Applies current style from stack to text, if must be applied.
 - createStyleFromString() : OutputFormatterStyleInterface|null
 - Tries to create new style instance from string.
 
Properties
$decorated
    private
        mixed
    $decorated
    
        
        
    
$styles
    private
        mixed
    $styles
     = []
        
        
    
$styleStack
    private
        mixed
    $styleStack
    
        
        
    
Methods
__construct()
Initializes console output formatter.
    public
                    __construct([bool $decorated = false ][, array<string|int, OutputFormatterStyleInterface> $styles = [] ]) : mixed
    
        Parameters
- $decorated : bool = false
 - $styles : array<string|int, OutputFormatterStyleInterface> = []
 - 
                    
Array of "name => FormatterStyle" instances
 
Return values
mixed —escape()
Escapes "<" special char in given text.
    public
            static        escape(string $text) : string
    
        Parameters
- $text : string
 - 
                    
Text to escape
 
Return values
string —Escaped text
format()
{@inheritdoc}
    public
                    format(mixed $message) : mixed
    
        Parameters
- $message : mixed
 
Return values
mixed —formatAndWrap()
Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping).
    public
                    formatAndWrap(string $message, int $width) : mixed
    
        Parameters
- $message : string
 - $width : int
 
Return values
mixed —getStyle()
{@inheritdoc}
    public
                    getStyle(mixed $name) : mixed
    
        Parameters
- $name : mixed
 
Return values
mixed —getStyleStack()
    public
                    getStyleStack() : OutputFormatterStyleStack
    
    
    
        Return values
OutputFormatterStyleStack —hasStyle()
{@inheritdoc}
    public
                    hasStyle(mixed $name) : mixed
    
        Parameters
- $name : mixed
 
Return values
mixed —isDecorated()
{@inheritdoc}
    public
                    isDecorated() : mixed
    
    
    
        Return values
mixed —setDecorated()
{@inheritdoc}
    public
                    setDecorated(mixed $decorated) : mixed
    
        Parameters
- $decorated : mixed
 
Return values
mixed —setStyle()
{@inheritdoc}
    public
                    setStyle(mixed $name, OutputFormatterStyleInterface $style) : mixed
    
        Parameters
- $name : mixed
 - $style : OutputFormatterStyleInterface
 
Return values
mixed —applyCurrentStyle()
Applies current style from stack to text, if must be applied.
    private
                    applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength) : string
    
        Parameters
- $text : string
 - $current : string
 - $width : int
 - $currentLineLength : int
 
Return values
string —createStyleFromString()
Tries to create new style instance from string.
    private
                    createStyleFromString(string $string) : OutputFormatterStyleInterface|null
    
        Parameters
- $string : string