class CliOutput extends AbstractCliOutput implements ColorfulOutputInterface (View source)

Simple Cli Output

Methods

resource
getOutputStream()

getOutStream

setOutputStream(resource $outStream)

setOutStream

resource
getErrorStream()

Method to get property ErrorStream

setErrorStream(resource $errorStream)

Method to set property errorStream

__construct(ColorProcessorInterface $processor = null)

Constructor

out(string $text = '', boolean $nl = true)

Write a string to standard output

$this
err(string $text = '', boolean $nl = true)

Write a string to standard error output.

setProcessor(ColorProcessorInterface $processor)

Set a processor

Details

resource getOutputStream()

getOutStream

Return Value

resource

AbstractCliOutput setOutputStream(resource $outStream)

setOutStream

Parameters

resource $outStream

Return Value

AbstractCliOutput Return self to support chaining.

resource getErrorStream()

Method to get property ErrorStream

Return Value

resource

AbstractCliOutput setErrorStream(resource $errorStream)

Method to set property errorStream

Parameters

resource $errorStream

Return Value

AbstractCliOutput Return self to support chaining.

at line line 36
__construct(ColorProcessorInterface $processor = null)

Constructor

Parameters

ColorProcessorInterface $processor The output processor.

at line line 49
CliOutputInterface out(string $text = '', boolean $nl = true)

Write a string to standard output

Parameters

string $text The text to display.
boolean $nl True (default) to append a new line at the end of the output string.

Return Value

CliOutputInterface Instance of $this to allow chaining.

at line line 65
$this err(string $text = '', boolean $nl = true)

Write a string to standard error output.

Parameters

string $text The text to display.
boolean $nl True (default) to append a new line at the end of the output string.

Return Value

$this

at line line 81
CliOutput setProcessor(ColorProcessorInterface $processor)

Set a processor

Parameters

ColorProcessorInterface $processor The output processor.

Return Value

CliOutput Instance of $this to allow chaining.

at line line 96
ColorProcessorInterface getProcessor()

Get a processor

Return Value

ColorProcessorInterface

Exceptions

RuntimeException