Chris@0
|
1 <?php
|
Chris@0
|
2
|
Chris@0
|
3 /*
|
Chris@0
|
4 * This file is part of the Symfony package.
|
Chris@0
|
5 *
|
Chris@0
|
6 * (c) Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
7 *
|
Chris@0
|
8 * For the full copyright and license information, please view the LICENSE
|
Chris@0
|
9 * file that was distributed with this source code.
|
Chris@0
|
10 */
|
Chris@0
|
11
|
Chris@0
|
12 namespace Symfony\Component\Console\Output;
|
Chris@0
|
13
|
Chris@0
|
14 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
|
Chris@0
|
15
|
Chris@0
|
16 /**
|
Chris@0
|
17 * OutputInterface is the interface implemented by all Output classes.
|
Chris@0
|
18 *
|
Chris@0
|
19 * @author Fabien Potencier <fabien@symfony.com>
|
Chris@0
|
20 */
|
Chris@0
|
21 interface OutputInterface
|
Chris@0
|
22 {
|
Chris@0
|
23 const VERBOSITY_QUIET = 16;
|
Chris@0
|
24 const VERBOSITY_NORMAL = 32;
|
Chris@0
|
25 const VERBOSITY_VERBOSE = 64;
|
Chris@0
|
26 const VERBOSITY_VERY_VERBOSE = 128;
|
Chris@0
|
27 const VERBOSITY_DEBUG = 256;
|
Chris@0
|
28
|
Chris@0
|
29 const OUTPUT_NORMAL = 1;
|
Chris@0
|
30 const OUTPUT_RAW = 2;
|
Chris@0
|
31 const OUTPUT_PLAIN = 4;
|
Chris@0
|
32
|
Chris@0
|
33 /**
|
Chris@0
|
34 * Writes a message to the output.
|
Chris@0
|
35 *
|
Chris@17
|
36 * @param string|array $messages The message as an array of strings or a single string
|
Chris@0
|
37 * @param bool $newline Whether to add a newline
|
Chris@0
|
38 * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
|
Chris@0
|
39 */
|
Chris@0
|
40 public function write($messages, $newline = false, $options = 0);
|
Chris@0
|
41
|
Chris@0
|
42 /**
|
Chris@0
|
43 * Writes a message to the output and adds a newline at the end.
|
Chris@0
|
44 *
|
Chris@17
|
45 * @param string|array $messages The message as an array of strings or a single string
|
Chris@0
|
46 * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL
|
Chris@0
|
47 */
|
Chris@0
|
48 public function writeln($messages, $options = 0);
|
Chris@0
|
49
|
Chris@0
|
50 /**
|
Chris@0
|
51 * Sets the verbosity of the output.
|
Chris@0
|
52 *
|
Chris@0
|
53 * @param int $level The level of verbosity (one of the VERBOSITY constants)
|
Chris@0
|
54 */
|
Chris@0
|
55 public function setVerbosity($level);
|
Chris@0
|
56
|
Chris@0
|
57 /**
|
Chris@0
|
58 * Gets the current verbosity of the output.
|
Chris@0
|
59 *
|
Chris@0
|
60 * @return int The current level of verbosity (one of the VERBOSITY constants)
|
Chris@0
|
61 */
|
Chris@0
|
62 public function getVerbosity();
|
Chris@0
|
63
|
Chris@0
|
64 /**
|
Chris@0
|
65 * Returns whether verbosity is quiet (-q).
|
Chris@0
|
66 *
|
Chris@0
|
67 * @return bool true if verbosity is set to VERBOSITY_QUIET, false otherwise
|
Chris@0
|
68 */
|
Chris@0
|
69 public function isQuiet();
|
Chris@0
|
70
|
Chris@0
|
71 /**
|
Chris@0
|
72 * Returns whether verbosity is verbose (-v).
|
Chris@0
|
73 *
|
Chris@0
|
74 * @return bool true if verbosity is set to VERBOSITY_VERBOSE, false otherwise
|
Chris@0
|
75 */
|
Chris@0
|
76 public function isVerbose();
|
Chris@0
|
77
|
Chris@0
|
78 /**
|
Chris@0
|
79 * Returns whether verbosity is very verbose (-vv).
|
Chris@0
|
80 *
|
Chris@0
|
81 * @return bool true if verbosity is set to VERBOSITY_VERY_VERBOSE, false otherwise
|
Chris@0
|
82 */
|
Chris@0
|
83 public function isVeryVerbose();
|
Chris@0
|
84
|
Chris@0
|
85 /**
|
Chris@0
|
86 * Returns whether verbosity is debug (-vvv).
|
Chris@0
|
87 *
|
Chris@0
|
88 * @return bool true if verbosity is set to VERBOSITY_DEBUG, false otherwise
|
Chris@0
|
89 */
|
Chris@0
|
90 public function isDebug();
|
Chris@0
|
91
|
Chris@0
|
92 /**
|
Chris@0
|
93 * Sets the decorated flag.
|
Chris@0
|
94 *
|
Chris@0
|
95 * @param bool $decorated Whether to decorate the messages
|
Chris@0
|
96 */
|
Chris@0
|
97 public function setDecorated($decorated);
|
Chris@0
|
98
|
Chris@0
|
99 /**
|
Chris@0
|
100 * Gets the decorated flag.
|
Chris@0
|
101 *
|
Chris@0
|
102 * @return bool true if the output will decorate messages, false otherwise
|
Chris@0
|
103 */
|
Chris@0
|
104 public function isDecorated();
|
Chris@0
|
105
|
Chris@0
|
106 public function setFormatter(OutputFormatterInterface $formatter);
|
Chris@0
|
107
|
Chris@0
|
108 /**
|
Chris@0
|
109 * Returns current output formatter instance.
|
Chris@0
|
110 *
|
Chris@0
|
111 * @return OutputFormatterInterface
|
Chris@0
|
112 */
|
Chris@0
|
113 public function getFormatter();
|
Chris@0
|
114 }
|