4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Console\Style;
14 use Symfony\Component\Console\Formatter\OutputFormatterInterface;
15 use Symfony\Component\Console\Helper\ProgressBar;
16 use Symfony\Component\Console\Output\OutputInterface;
19 * Decorates output to add console style guide helpers.
21 * @author Kevin Bond <kevinbond@gmail.com>
23 abstract class OutputStyle implements OutputInterface, StyleInterface
28 * @param OutputInterface $output
30 public function __construct(OutputInterface $output)
32 $this->output = $output;
38 public function newLine($count = 1)
40 $this->output->write(str_repeat(PHP_EOL, $count));
48 public function createProgressBar($max = 0)
50 return new ProgressBar($this->output, $max);
56 public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
58 $this->output->write($messages, $newline, $type);
64 public function writeln($messages, $type = self::OUTPUT_NORMAL)
66 $this->output->writeln($messages, $type);
72 public function setVerbosity($level)
74 $this->output->setVerbosity($level);
80 public function getVerbosity()
82 return $this->output->getVerbosity();
88 public function setDecorated($decorated)
90 $this->output->setDecorated($decorated);
96 public function isDecorated()
98 return $this->output->isDecorated();
104 public function setFormatter(OutputFormatterInterface $formatter)
106 $this->output->setFormatter($formatter);
112 public function getFormatter()
114 return $this->output->getFormatter();