summaryrefslogtreecommitdiff
path: root/vendor/symfony/console/Style/OutputStyle.php
diff options
context:
space:
mode:
authorpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
committerpolo <ordipolo@gmx.fr>2024-08-13 23:45:21 +0200
commitbf6655a534a6775d30cafa67bd801276bda1d98d (patch)
treec6381e3f6c81c33eab72508f410b165ba05f7e9c /vendor/symfony/console/Style/OutputStyle.php
parent94d67a4b51f8e62e7d518cce26a526ae1ec48278 (diff)
downloadAppliGestionPHP-bf6655a534a6775d30cafa67bd801276bda1d98d.zip
VERSION 0.2 doctrine ORM et entités
Diffstat (limited to 'vendor/symfony/console/Style/OutputStyle.php')
-rw-r--r--vendor/symfony/console/Style/OutputStyle.php109
1 files changed, 109 insertions, 0 deletions
diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php
new file mode 100644
index 0000000..9f62ea3
--- /dev/null
+++ b/vendor/symfony/console/Style/OutputStyle.php
@@ -0,0 +1,109 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Console\Style;
13
14use Symfony\Component\Console\Formatter\OutputFormatterInterface;
15use Symfony\Component\Console\Helper\ProgressBar;
16use Symfony\Component\Console\Output\ConsoleOutputInterface;
17use Symfony\Component\Console\Output\OutputInterface;
18
19/**
20 * Decorates output to add console style guide helpers.
21 *
22 * @author Kevin Bond <kevinbond@gmail.com>
23 */
24abstract class OutputStyle implements OutputInterface, StyleInterface
25{
26 public function __construct(
27 private OutputInterface $output,
28 ) {
29 }
30
31 public function newLine(int $count = 1): void
32 {
33 $this->output->write(str_repeat(\PHP_EOL, $count));
34 }
35
36 public function createProgressBar(int $max = 0): ProgressBar
37 {
38 return new ProgressBar($this->output, $max);
39 }
40
41 public function write(string|iterable $messages, bool $newline = false, int $type = self::OUTPUT_NORMAL): void
42 {
43 $this->output->write($messages, $newline, $type);
44 }
45
46 public function writeln(string|iterable $messages, int $type = self::OUTPUT_NORMAL): void
47 {
48 $this->output->writeln($messages, $type);
49 }
50
51 public function setVerbosity(int $level): void
52 {
53 $this->output->setVerbosity($level);
54 }
55
56 public function getVerbosity(): int
57 {
58 return $this->output->getVerbosity();
59 }
60
61 public function setDecorated(bool $decorated): void
62 {
63 $this->output->setDecorated($decorated);
64 }
65
66 public function isDecorated(): bool
67 {
68 return $this->output->isDecorated();
69 }
70
71 public function setFormatter(OutputFormatterInterface $formatter): void
72 {
73 $this->output->setFormatter($formatter);
74 }
75
76 public function getFormatter(): OutputFormatterInterface
77 {
78 return $this->output->getFormatter();
79 }
80
81 public function isQuiet(): bool
82 {
83 return $this->output->isQuiet();
84 }
85
86 public function isVerbose(): bool
87 {
88 return $this->output->isVerbose();
89 }
90
91 public function isVeryVerbose(): bool
92 {
93 return $this->output->isVeryVerbose();
94 }
95
96 public function isDebug(): bool
97 {
98 return $this->output->isDebug();
99 }
100
101 protected function getErrorOutput(): OutputInterface
102 {
103 if (!$this->output instanceof ConsoleOutputInterface) {
104 return $this->output;
105 }
106
107 return $this->output->getErrorOutput();
108 }
109}