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 Environment $environment Environment.
protected bool $muted Is the output muted?

Methods

__construct(WriterInterface $standard, WriterInterface $error, FormatterInterface|null $formatter = null, Environment|null $environment = null)

Constructor.

getWriter(int $writer = Output::STANDARD)

Returns the chosen writer.

setFormatter(FormatterInterface $formatter)

Sets the formatter.

getFormatter()

Returns the formatter.

getEnvironment()

Returns the environment.

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.

dump(mixed $value, int $writer = Output::STANDARD)

Dumps a value to the output.

clear()

Clears the screen.

clearLine()

Clears the current line.

clearLines(int $lines)

Clears n lines.

Details

at line 78
__construct(WriterInterface $standard, WriterInterface $error, FormatterInterface|null $formatter = null, Environment|null $environment = null)

Constructor.

Parameters

WriterInterface $standard Standard writer
WriterInterface $error Error writer
FormatterInterface|null $formatter Formatter
Environment|null $environment Environment

at line 95
WriterInterface getWriter(int $writer = Output::STANDARD)

Returns the chosen writer.

Parameters

int $writer Writer

Return Value

WriterInterface

at line 105
setFormatter(FormatterInterface $formatter)

Sets the formatter.

Parameters

FormatterInterface $formatter Formatter

at line 115
FormatterInterface|null getFormatter()

Returns the formatter.

Return Value

FormatterInterface|null

at line 125
Environment getEnvironment()

Returns the environment.

Return Value

Environment

at line 133
mute()

Mutes the output.

at line 141
unmute()

Unmutes the output.

at line 151
bool isMuted()

Is the output muted?

Return Value

bool

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

Writes string to output.

Parameters

string $string String to write
int $writer Output type

at line 189
error(string $string)

Writes string to output using the error writer.

Parameters

string $string String to write

at line 200
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 210
errorLn(string $string)

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

Parameters

string $string String to write

at line 221
dump(mixed $value, int $writer = Output::STANDARD)

Dumps a value to the output.

Parameters

mixed $value Value
int $writer Output type

at line 229
clear()

Clears the screen.

at line 240
clearLine()

Clears the current line.

at line 253
clearLines(int $lines)

Clears n lines.

Parameters

int $lines Number of lines to clear