[ Index ]

PHP Cross Reference of phpBB-3.1.12-deutsch

title

Body

[close]

/vendor/symfony/console/Symfony/Component/Console/Descriptor/ -> Descriptor.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\Descriptor;
  13  
  14  use Symfony\Component\Console\Application;
  15  use Symfony\Component\Console\Command\Command;
  16  use Symfony\Component\Console\Input\InputArgument;
  17  use Symfony\Component\Console\Input\InputDefinition;
  18  use Symfony\Component\Console\Input\InputOption;
  19  
  20  /**
  21   * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
  22   */
  23  abstract class Descriptor implements DescriptorInterface
  24  {
  25      public function describe($object, array $options = array())
  26      {
  27          switch (true) {
  28              case $object instanceof InputArgument:
  29                  return $this->describeInputArgument($object, $options);
  30              case $object instanceof InputOption:
  31                  return $this->describeInputOption($object, $options);
  32              case $object instanceof InputDefinition:
  33                  return $this->describeInputDefinition($object, $options);
  34              case $object instanceof Command:
  35                  return $this->describeCommand($object, $options);
  36              case $object instanceof Application:
  37                  return $this->describeApplication($object, $options);
  38          }
  39  
  40          throw new \InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
  41      }
  42  
  43      /**
  44       * Describes an InputArgument instance.
  45       *
  46       * @param InputArgument $argument
  47       * @param array         $options
  48       *
  49       * @return string|mixed
  50       */
  51      abstract protected function describeInputArgument(InputArgument $argument, array $options = array());
  52  
  53      /**
  54       * Describes an InputOption instance.
  55       *
  56       * @param InputOption $option
  57       * @param array       $options
  58       *
  59       * @return string|mixed
  60       */
  61      abstract protected function describeInputOption(InputOption $option, array $options = array());
  62  
  63      /**
  64       * Describes an InputDefinition instance.
  65       *
  66       * @param InputDefinition $definition
  67       * @param array           $options
  68       *
  69       * @return string|mixed
  70       */
  71      abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());
  72  
  73      /**
  74       * Describes a Command instance.
  75       *
  76       * @param Command $command
  77       * @param array   $options
  78       *
  79       * @return string|mixed
  80       */
  81      abstract protected function describeCommand(Command $command, array $options = array());
  82  
  83      /**
  84       * Describes an Application instance.
  85       *
  86       * @param Application $application
  87       * @param array       $options
  88       *
  89       * @return string|mixed
  90       */
  91      abstract protected function describeApplication(Application $application, array $options = array());
  92  }


Generated: Thu Jan 11 00:25:41 2018 Cross-referenced by PHPXref 0.7.1