comparison vendor/symfony/console/Style/OutputStyle.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 1fec387a4317
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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
12 namespace Symfony\Component\Console\Style;
13
14 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
15 use Symfony\Component\Console\Helper\ProgressBar;
16 use Symfony\Component\Console\Output\OutputInterface;
17
18 /**
19 * Decorates output to add console style guide helpers.
20 *
21 * @author Kevin Bond <kevinbond@gmail.com>
22 */
23 abstract class OutputStyle implements OutputInterface, StyleInterface
24 {
25 private $output;
26
27 /**
28 * @param OutputInterface $output
29 */
30 public function __construct(OutputInterface $output)
31 {
32 $this->output = $output;
33 }
34
35 /**
36 * {@inheritdoc}
37 */
38 public function newLine($count = 1)
39 {
40 $this->output->write(str_repeat(PHP_EOL, $count));
41 }
42
43 /**
44 * @param int $max
45 *
46 * @return ProgressBar
47 */
48 public function createProgressBar($max = 0)
49 {
50 return new ProgressBar($this->output, $max);
51 }
52
53 /**
54 * {@inheritdoc}
55 */
56 public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
57 {
58 $this->output->write($messages, $newline, $type);
59 }
60
61 /**
62 * {@inheritdoc}
63 */
64 public function writeln($messages, $type = self::OUTPUT_NORMAL)
65 {
66 $this->output->writeln($messages, $type);
67 }
68
69 /**
70 * {@inheritdoc}
71 */
72 public function setVerbosity($level)
73 {
74 $this->output->setVerbosity($level);
75 }
76
77 /**
78 * {@inheritdoc}
79 */
80 public function getVerbosity()
81 {
82 return $this->output->getVerbosity();
83 }
84
85 /**
86 * {@inheritdoc}
87 */
88 public function setDecorated($decorated)
89 {
90 $this->output->setDecorated($decorated);
91 }
92
93 /**
94 * {@inheritdoc}
95 */
96 public function isDecorated()
97 {
98 return $this->output->isDecorated();
99 }
100
101 /**
102 * {@inheritdoc}
103 */
104 public function setFormatter(OutputFormatterInterface $formatter)
105 {
106 $this->output->setFormatter($formatter);
107 }
108
109 /**
110 * {@inheritdoc}
111 */
112 public function getFormatter()
113 {
114 return $this->output->getFormatter();
115 }
116
117 /**
118 * {@inheritdoc}
119 */
120 public function isQuiet()
121 {
122 return $this->output->isQuiet();
123 }
124
125 /**
126 * {@inheritdoc}
127 */
128 public function isVerbose()
129 {
130 return $this->output->isVerbose();
131 }
132
133 /**
134 * {@inheritdoc}
135 */
136 public function isVeryVerbose()
137 {
138 return $this->output->isVeryVerbose();
139 }
140
141 /**
142 * {@inheritdoc}
143 */
144 public function isDebug()
145 {
146 return $this->output->isDebug();
147 }
148 }