ConsoleOutput
class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
ConsoleOutput is the default class for all CLI output. It uses STDOUT.
This class is a convenient wrapper around StreamOutput
.
$output = new ConsoleOutput();
This is equivalent to:
$output = new StreamOutput(fopen('php://stdout', 'w'));
Methods
Constructor.
Sets the decorated flag.
Sets the verbosity of the output.
Writes a message to the output and adds a newline at the end.
Writes a message to the output.
Gets the OutputInterface for errors.
Details
at line line 43
__construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null)
Constructor.
at line line 67
setFormatter(OutputFormatterInterface $formatter)
Sets output formatter.
in Output at line line 60
OutputFormatterInterface
getFormatter()
Returns current output formatter instance.
at line line 58
setDecorated(bool $decorated)
Sets the decorated flag.
in Output at line line 76
bool
isDecorated()
Gets the decorated flag.
at line line 76
setVerbosity(int $level)
Sets the verbosity of the output.
in Output at line line 92
int
getVerbosity()
Gets the current verbosity of the output.
in Output at line line 97
isQuiet()
in Output at line line 102
isVerbose()
in Output at line line 107
isVeryVerbose()
in Output at line line 112
isDebug()
in Output at line line 120
writeln(string|array $messages, int $options = self::OUTPUT_NORMAL)
Writes a message to the output and adds a newline at the end.
in Output at line line 128
write(string|array $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL)
Writes a message to the output.
in StreamOutput at line line 65
resource
getStream()
Gets the stream attached to this StreamOutput instance.
at line line 85
OutputInterface
getErrorOutput()
Gets the OutputInterface for errors.
at line line 93
setErrorOutput(OutputInterface $error)
Sets the OutputInterface used for errors.