final class CommandOutput (View source)

Writes command output to separate standard-output and standard-error streams.

Methods

__construct(mixed $stdout, mixed $stderr)

Creates output backed by writable stream resources.

void
write(string $message)

Writes a message to standard output without adding a line ending.

void
void
writeln(string $message = '')

Writes a message followed by the platform line ending to standard output.

void
void
error(string $message)

Writes a message to standard error without adding a line ending.

void
void
errorln(string $message = '')

Writes a message followed by the platform line ending to standard error.

void

Details

__construct

__construct(mixed $stdout, mixed $stderr)

Creates output backed by writable stream resources.

Parameters

mixed $stdout

Standard-output stream.

mixed $stderr

Standard-error stream.

Exceptions

InvalidArgumentException

write

void write(string $message)

Writes a message to standard output without adding a line ending.

Parameters

string $message

Return Value

void

writeln

void writeln(string $message = '')

Writes a message followed by the platform line ending to standard output.

Parameters

string $message

Return Value

void

error

void error(string $message)

Writes a message to standard error without adding a line ending.

Parameters

string $message

Return Value

void

errorln

void errorln(string $message = '')

Writes a message followed by the platform line ending to standard error.

Parameters

string $message

Return Value

void