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