4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Output;
14 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
17 * OutputInterface is the interface implemented by all Output classes.
19 * @author Fabien Potencier <fabien@symfony.com>
23 interface OutputInterface
25 const VERBOSITY_QUIET = 0;
26 const VERBOSITY_NORMAL = 1;
27 const VERBOSITY_VERBOSE = 2;
29 const OUTPUT_NORMAL = 0;
31 const OUTPUT_PLAIN = 2;
34 * Writes a message to the output.
36 * @param string|array $messages The message as an array of lines of a single string
37 * @param Boolean $newline Whether to add a newline or not
38 * @param integer $type The type of output (0: normal, 1: raw, 2: plain)
40 * @throws \InvalidArgumentException When unknown output type is given
44 public function write($messages, $newline = false, $type = 0);
47 * Writes a message to the output and adds a newline at the end.
49 * @param string|array $messages The message as an array of lines of a single string
50 * @param integer $type The type of output (0: normal, 1: raw, 2: plain)
54 public function writeln($messages, $type = 0);
57 * Sets the verbosity of the output.
59 * @param integer $level The level of verbosity
63 public function setVerbosity($level);
66 * Gets the current verbosity of the output.
68 * @return integer The current level of verbosity
72 public function getVerbosity();
75 * Sets the decorated flag.
77 * @param Boolean $decorated Whether to decorate the messages or not
81 public function setDecorated($decorated);
84 * Gets the decorated flag.
86 * @return Boolean true if the output will decorate messages, false otherwise
90 public function isDecorated();
93 * Sets output formatter.
95 * @param OutputFormatterInterface $formatter
99 public function setFormatter(OutputFormatterInterface $formatter);
102 * Returns current output formatter instance.
104 * @return OutputFormatterInterface
108 public function getFormatter();