Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/console/Style/SymfonyStyle.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children | 129ea1e6d783 |
line wrap: on
line diff
--- a/vendor/symfony/console/Style/SymfonyStyle.php Mon Apr 23 09:33:26 2018 +0100 +++ b/vendor/symfony/console/Style/SymfonyStyle.php Mon Apr 23 09:46:53 2018 +0100 @@ -40,10 +40,6 @@ private $lineLength; private $bufferedOutput; - /** - * @param InputInterface $input - * @param OutputInterface $output - */ public function __construct(InputInterface $input, OutputInterface $output) { $this->input = $input; @@ -63,13 +59,14 @@ * @param string|null $style The style to apply to the whole block * @param string $prefix The prefix for the block * @param bool $padding Whether to add vertical padding + * @param bool $escape Whether to escape the message */ - public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false) + public function block($messages, $type = null, $style = null, $prefix = ' ', $padding = false, $escape = true) { $messages = is_array($messages) ? array_values($messages) : array($messages); $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, true)); + $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); $this->newLine(); } @@ -133,11 +130,7 @@ */ public function comment($message) { - $messages = is_array($message) ? array_values($message) : array($message); - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, null, null, '<fg=default;bg=default> // </>')); - $this->newLine(); + $this->block($message, null, null, '<fg=default;bg=default> // </>', false, false); } /** @@ -286,9 +279,7 @@ } /** - * @param Question $question - * - * @return string + * @return mixed */ public function askQuestion(Question $question) { @@ -338,6 +329,16 @@ } /** + * Returns a new instance which makes use of stderr if available. + * + * @return self + */ + public function getErrorStyle() + { + return new self($this->input, $this->getErrorOutput()); + } + + /** * @return ProgressBar */ private function getProgressBar()