Copied!

Formatter class for console output.

CloneableInstantiable
Methods
public __clone()
public __construct(bool $decorated = false, array $styles = [])
 

Initializes console output formatter.

  • param \OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances
public static escape(string $text) : string
 

Escapes "<" and ">" special chars in given text.

public static escapeTrailingBackslash(string $text) : string
 

Escapes trailing "\" in given text.

  • internal
public format(?string $message) : ?string
public formatAndWrap(?string $message, int $width)
 
  • return string
public getStyle(string $name) : Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
public getStyleStack() : Symfony\Component\Console\Formatter\OutputFormatterStyleStack
public hasStyle(string $name) : bool
public isDecorated() : bool
public setDecorated(bool $decorated)
 
  • return void
public setStyle(string $name, Symfony\Component\Console\Formatter\OutputFormatterStyleInterface $style)
 
  • return void
Properties
private bool $decorated
private array $styles = []
private Symfony\Component\Console\Formatter\OutputFormatterStyleStack $styleStack
Methods
private addLineBreaks(string $text, int $width) : string
private applyCurrentStyle(string $text, string $current, int $width, int $currentLineLength) : string
 

Applies current style from stack to text, if must be applied.

private createStyleFromString(string $string) : ?Symfony\Component\Console\Formatter\OutputFormatterStyleInterface
 

Tries to create new style instance from string.

Methods
public static escape(string $text) : string
 

Escapes "<" and ">" special chars in given text.

public static escapeTrailingBackslash(string $text) : string
 

Escapes trailing "\" in given text.

  • internal
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration