interface OutputInterface

OutputInterface is the interface implemented by all Output classes.

Constants

VERBOSITY_QUIET

VERBOSITY_NORMAL

VERBOSITY_VERBOSE

VERBOSITY_VERY_VERBOSE

VERBOSITY_DEBUG

OUTPUT_NORMAL

OUTPUT_RAW

OUTPUT_PLAIN

Methods

write(string|array $messages, Boolean $newline = false, integer $type = self::OUTPUT_NORMAL)

Writes a message to the output.

writeln(string|array $messages, integer $type = self::OUTPUT_NORMAL)

Writes a message to the output and adds a newline at the end.

setVerbosity(integer $level)

Sets the verbosity of the output.

integer
getVerbosity()

Gets the current verbosity of the output.

setDecorated(Boolean $decorated)

Sets the decorated flag.

Boolean
isDecorated()

Gets the decorated flag.

setFormatter(OutputFormatterInterface $formatter)

Sets output formatter.

getFormatter()

Returns current output formatter instance.

Details

at line line 46
write(string|array $messages, Boolean $newline = false, integer $type = self::OUTPUT_NORMAL)

Writes a message to the output.

Parameters

string|array $messages The message as an array of lines or a single string
Boolean $newline Whether to add a newline
integer $type The type of output (one of the OUTPUT constants)

Exceptions

InvalidArgumentException When unknown output type is given

at line line 58
writeln(string|array $messages, integer $type = self::OUTPUT_NORMAL)

Writes a message to the output and adds a newline at the end.

Parameters

string|array $messages The message as an array of lines of a single string
integer $type The type of output (one of the OUTPUT constants)

Exceptions

InvalidArgumentException When unknown output type is given

at line line 67
setVerbosity(integer $level)

Sets the verbosity of the output.

Parameters

integer $level The level of verbosity (one of the VERBOSITY constants)

at line line 76
integer getVerbosity()

Gets the current verbosity of the output.

Return Value

integer The current level of verbosity (one of the VERBOSITY constants)

at line line 85
setDecorated(Boolean $decorated)

Sets the decorated flag.

Parameters

Boolean $decorated Whether to decorate the messages

at line line 94
Boolean isDecorated()

Gets the decorated flag.

Return Value

Boolean true if the output will decorate messages, false otherwise

at line line 103
setFormatter(OutputFormatterInterface $formatter)

Sets output formatter.

Parameters

OutputFormatterInterface $formatter

at line line 112
OutputFormatterInterface getFormatter()

Returns current output formatter instance.