Debian Codegraph @

vendor/symfony/console/Output/NullOutput.php

raw
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\NullOutputFormatter;
15 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
16
17 /**
18 * NullOutput suppresses all output.
19 *
20 * $output = new NullOutput();
21 *
22 * @author Fabien Potencier <[email protected]>
23 * @author Tobias Schultze <http://tobion.de>
24 */
25 class NullOutput implements OutputInterface
26 {
27 private NullOutputFormatter $formatter;
28
29 public function setFormatter(OutputFormatterInterface $formatter): void
30 {
31 // do nothing
32 }
33
34 public function getFormatter(): OutputFormatterInterface
35 {
36 // to comply with the interface we must return a OutputFormatterInterface
37 return $this->formatter ??= new NullOutputFormatter();
38 }
39
40 public function setDecorated(bool $decorated): void
41 {
42 // do nothing
43 }
44
45 public function isDecorated(): bool
46 {
47 return false;
48 }
49
50 public function setVerbosity(int $level): void
51 {
52 // do nothing
53 }
54
55 public function getVerbosity(): int
56 {
57 return self::VERBOSITY_SILENT;
58 }
59
60 public function isSilent(): bool
61 {
62 return true;
63 }
64
65 public function isQuiet(): bool
66 {
67 return false;
68 }
69
70 public function isVerbose(): bool
71 {
72 return false;
73 }
74
75 public function isVeryVerbose(): bool
76 {
77 return false;
78 }
79
80 public function isDebug(): bool
81 {
82 return false;
83 }
84
85 public function writeln(string|iterable $messages, int $options = self::OUTPUT_NORMAL): void
86 {
87 // do nothing
88 }
89
90 public function write(string|iterable $messages, bool $newline = false, int $options = self::OUTPUT_NORMAL): void
91 {
92 // do nothing
93 }
94 }