OutputFormatter

class OutputFormatter implements OutputFormatterInterface Formatter class for console output. Methods static string escape(string $text) Escapes "<" special char in given text. __construct(bool $decorated = false, array $styles = array()) Initializes console output formatter. setDecorated(bool $decorated) Sets the decorated flag. bool isDecorated() Gets the decorated flag. setStyle(string $name, OutputFormatterStyleInterface $style) Sets a new style. bool hasS

Output::writeln()

writeln(string|array $messages, int $options = self::OUTPUT_NORMAL) Writes a message to the output and adds a newline at the end. Parameters string|array $messages The message as an array of lines of a single string int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUTNORMAL | self::VERBOSITYNORMAL

Output::write()

write(string|array $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) Writes a message to the output. Parameters string|array $messages The message as an array of lines or a single string bool $newline Whether to add a newline int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUTNORMAL | self::VERBOSITYNORMAL

Output::setVerbosity()

setVerbosity(int $level) Sets the verbosity of the output. Parameters int $level The level of verbosity (one of the VERBOSITY constants)

Output::setFormatter()

setFormatter(OutputFormatterInterface $formatter) Sets output formatter. Parameters OutputFormatterInterface $formatter

Output::setDecorated()

setDecorated(bool $decorated) Sets the decorated flag. Parameters bool $decorated Whether to decorate the messages

Output::isVeryVerbose()

bool isVeryVerbose() Returns whether verbosity is very verbose (-vv). Return Value bool true if verbosity is set to VERBOSITYVERYVERBOSE, false otherwise

Output::isVerbose()

bool isVerbose() Returns whether verbosity is verbose (-v). Return Value bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise

Output::isQuiet()

bool isQuiet() Returns whether verbosity is quiet (-q). Return Value bool true if verbosity is set to VERBOSITY_QUIET, false otherwise

Output::isDecorated()

bool isDecorated() Gets the decorated flag. Return Value bool true if the output will decorate messages, false otherwise