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.

void
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 80
__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 97
WriterInterface getWriter(int $writer = Output::STANDARD)

Returns the chosen writer.

Parameters

int $writer Writer

Return Value

WriterInterface

at line 107
setFormatter(FormatterInterface $formatter)

Sets the formatter.

Parameters

FormatterInterface $formatter Formatter

at line 117
FormatterInterface|null getFormatter()

Returns the formatter.

Return Value

FormatterInterface|null

at line 127
Environment getEnvironment()

Returns the environment.

Return Value

Environment

at line 135
mute()

Mutes the output.

at line 143
unmute()

Unmutes the output.

at line 153
bool isMuted()

Is the output muted?

Return Value

bool

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

Writes string to output.

Parameters

string $string String to write
int $writer Output type

at line 191
error(string $string)

Writes string to output using the error writer.

Parameters

string $string String to write

at line 202
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 212
errorLn(string $string)

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

Parameters

string $string String to write

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

Dumps a value to the output.

Parameters

mixed $value Value
int $writer Output type

Return Value

void

at line 232
clear()

Clears the screen.

at line 243
clearLine()

Clears the current line.

at line 256
clearLines(int $lines)

Clears n lines.

Parameters

int $lines Number of lines to clear