Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • AnsiFormatter
  • DefaultStyleSet
  • NullFormatter
  • PlainFormatter
  • Overview
  • Namespace
  • Class

Class AnsiFormatter

A formatter that replaces style tags by ANSI format codes.

Webmozart\Console\Formatter\AnsiFormatter implements Webmozart\Console\Api\Formatter\Formatter
Namespace: Webmozart\Console\Formatter
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at Formatter/AnsiFormatter.php
Methods summary
public
# __construct( Webmozart\Console\Api\Formatter\StyleSet $styleSet = null )

Creates the formatter.

Creates the formatter.

Parameters

$styleSet
The style set to use.
public string
# format( string $string, Webmozart\Console\Api\Formatter\Style $style = null )

Formats the given string.

Formats the given string.

Parameters

$string
The string to format.
$style
The style to use.

Returns

string
The formatted string.

Implementation of

Webmozart\Console\Api\Formatter\Formatter::format()
public string
# removeFormat( string $string )

Removes the format tags from the given string.

Removes the format tags from the given string.

Parameters

$string
The string to remove the format tags from.

Returns

string
The string without format tags.

Implementation of

Webmozart\Console\Api\Formatter\Formatter::removeFormat()
Webmozart Console API API documentation generated by ApiGen