[ Index ]

PHP Cross Reference of phpBB-3.3.12-deutsch

title

Body

[close]

/vendor/symfony/console/Style/ -> OutputStyle.php (source)

   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\ConsoleOutputInterface;
  17  use 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   */
  24  abstract class OutputStyle implements OutputInterface, StyleInterface
  25  {
  26      private $output;
  27  
  28      public function __construct(OutputInterface $output)
  29      {
  30          $this->output = $output;
  31      }
  32  
  33      /**
  34       * {@inheritdoc}
  35       */
  36      public function newLine($count = 1)
  37      {
  38          $this->output->write(str_repeat(\PHP_EOL, $count));
  39      }
  40  
  41      /**
  42       * @param int $max
  43       *
  44       * @return ProgressBar
  45       */
  46      public function createProgressBar($max = 0)
  47      {
  48          return new ProgressBar($this->output, $max);
  49      }
  50  
  51      /**
  52       * {@inheritdoc}
  53       */
  54      public function write($messages, $newline = false, $type = self::OUTPUT_NORMAL)
  55      {
  56          $this->output->write($messages, $newline, $type);
  57      }
  58  
  59      /**
  60       * {@inheritdoc}
  61       */
  62      public function writeln($messages, $type = self::OUTPUT_NORMAL)
  63      {
  64          $this->output->writeln($messages, $type);
  65      }
  66  
  67      /**
  68       * {@inheritdoc}
  69       */
  70      public function setVerbosity($level)
  71      {
  72          $this->output->setVerbosity($level);
  73      }
  74  
  75      /**
  76       * {@inheritdoc}
  77       */
  78      public function getVerbosity()
  79      {
  80          return $this->output->getVerbosity();
  81      }
  82  
  83      /**
  84       * {@inheritdoc}
  85       */
  86      public function setDecorated($decorated)
  87      {
  88          $this->output->setDecorated($decorated);
  89      }
  90  
  91      /**
  92       * {@inheritdoc}
  93       */
  94      public function isDecorated()
  95      {
  96          return $this->output->isDecorated();
  97      }
  98  
  99      /**
 100       * {@inheritdoc}
 101       */
 102      public function setFormatter(OutputFormatterInterface $formatter)
 103      {
 104          $this->output->setFormatter($formatter);
 105      }
 106  
 107      /**
 108       * {@inheritdoc}
 109       */
 110      public function getFormatter()
 111      {
 112          return $this->output->getFormatter();
 113      }
 114  
 115      /**
 116       * {@inheritdoc}
 117       */
 118      public function isQuiet()
 119      {
 120          return $this->output->isQuiet();
 121      }
 122  
 123      /**
 124       * {@inheritdoc}
 125       */
 126      public function isVerbose()
 127      {
 128          return $this->output->isVerbose();
 129      }
 130  
 131      /**
 132       * {@inheritdoc}
 133       */
 134      public function isVeryVerbose()
 135      {
 136          return $this->output->isVeryVerbose();
 137      }
 138  
 139      /**
 140       * {@inheritdoc}
 141       */
 142      public function isDebug()
 143      {
 144          return $this->output->isDebug();
 145      }
 146  
 147      protected function getErrorOutput()
 148      {
 149          if (!$this->output instanceof ConsoleOutputInterface) {
 150              return $this->output;
 151          }
 152  
 153          return $this->output->getErrorOutput();
 154      }
 155  }


Generated: Sun Jun 23 12:25:44 2024 Cross-referenced by PHPXref 0.7.1