class Output

Output.

Constants

STANDARD

Standard output.

ERROR

Error output.

Properties

protected WriterInterface $standard Standard writer.
protected WriterInterface $error Error writer.
protected FormatterInterface|null $formatter Formatter.
protected bool $hasAnsiSupport Do we have ANSI support?
protected bool $muted Is the output muted?

Methods

__construct(WriterInterface $standard, WriterInterface $error, FormatterInterface $formatter = null, bool $hasAnsiSupport = null)

Constructor.

bool
hasAnsiSupport()

Do we have ANSI support?

setFormatter(FormatterInterface $formatter)

Sets the formatter.

getFormatter()

Returns the formatter.

mute()

Mutes the output.

unmute()

Unmutes the output.

bool
isMuted()

Is the output muted?

write(string $string, int $writer = Output::STANDARD)

Writes string to output.

error(string $string)

Writes string to output using the error writer.

writeLn(string $string, int $writer = Output::STANDARD)

Appends newline to string and writes it to output.

errorLn(string $string)

Appends newline to string and writes it to output using the error writer.

clear()

Clears the screen.

clearLine()

Clears the current line.

clearLines(int $lines)

Clears n lines.

Details

at line 79
__construct(WriterInterface $standard, WriterInterface $error, FormatterInterface $formatter = null, bool $hasAnsiSupport = null)

Constructor.

Parameters

WriterInterface $standard Standard writer
WriterInterface $error Error writer
FormatterInterface $formatter Formatter
bool $hasAnsiSupport Do we have ANSI support?

at line 102
bool hasAnsiSupport()

Do we have ANSI support?

Return Value

bool

at line 112
setFormatter(FormatterInterface $formatter)

Sets the formatter.

Parameters

FormatterInterface $formatter Formatter

at line 122
FormatterInterface|null getFormatter()

Returns the formatter.

Return Value

FormatterInterface|null

at line 130
mute()

Mutes the output.

at line 138
unmute()

Unmutes the output.

at line 148
bool isMuted()

Is the output muted?

Return Value

bool

at line 159
write(string $string, int $writer = Output::STANDARD)

Writes string to output.

Parameters

string $string String to write
int $writer Output type

at line 186
error(string $string)

Writes string to output using the error writer.

Parameters

string $string String to write

at line 197
writeLn(string $string, int $writer = Output::STANDARD)

Appends newline to string and writes it to output.

Parameters

string $string String to write
int $writer Output type

at line 207
errorLn(string $string)

Appends newline to string and writes it to output using the error writer.

Parameters

string $string String to write

at line 215
clear()

Clears the screen.

at line 226
clearLine()

Clears the current line.

at line 239
clearLines(int $lines)

Clears n lines.

Parameters

int $lines Number of lines to clear