Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

Descriptor.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 3.51 KiB


001  <?php
002   
003  /*
004   * This file is part of the Symfony package.
005   *
006   * (c) Fabien Potencier <fabien@symfony.com>
007   *
008   * For the full copyright and license information, please view the LICENSE
009   * file that was distributed with this source code.
010   */
011   
012  namespace Symfony\Component\Console\Descriptor;
013   
014  use Symfony\Component\Console\Application;
015  use Symfony\Component\Console\Command\Command;
016  use Symfony\Component\Console\Input\InputArgument;
017  use Symfony\Component\Console\Input\InputDefinition;
018  use Symfony\Component\Console\Input\InputOption;
019  use Symfony\Component\Console\Output\OutputInterface;
020  use Symfony\Component\Console\Exception\InvalidArgumentException;
021   
022  /**
023   * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
024   *
025   * @internal
026   */
027  abstract class Descriptor implements DescriptorInterface
028  {
029      /**
030       * @var OutputInterface
031       */
032      private $output;
033   
034      /**
035       * {@inheritdoc}
036       */
037      public function describe(OutputInterface $output, $object, array $options = array())
038      {
039          $this->output = $output;
040   
041          switch (true) {
042              case $object instanceof InputArgument:
043                  $this->describeInputArgument($object, $options);
044                  break;
045              case $object instanceof InputOption:
046                  $this->describeInputOption($object, $options);
047                  break;
048              case $object instanceof InputDefinition:
049                  $this->describeInputDefinition($object, $options);
050                  break;
051              case $object instanceof Command:
052                  $this->describeCommand($object, $options);
053                  break;
054              case $object instanceof Application:
055                  $this->describeApplication($object, $options);
056                  break;
057              default:
058                  throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_class($object)));
059          }
060      }
061   
062      /**
063       * Writes content to output.
064       *
065       * @param string $content
066       * @param bool   $decorated
067       */
068      protected function write($content, $decorated = false)
069      {
070          $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW);
071      }
072   
073      /**
074       * Describes an InputArgument instance.
075       *
076       * @param InputArgument $argument
077       * @param array         $options
078       *
079       * @return string|mixed
080       */
081      abstract protected function describeInputArgument(InputArgument $argument, array $options = array());
082   
083      /**
084       * Describes an InputOption instance.
085       *
086       * @param InputOption $option
087       * @param array       $options
088       *
089       * @return string|mixed
090       */
091      abstract protected function describeInputOption(InputOption $option, array $options = array());
092   
093      /**
094       * Describes an InputDefinition instance.
095       *
096       * @param InputDefinition $definition
097       * @param array           $options
098       *
099       * @return string|mixed
100       */
101      abstract protected function describeInputDefinition(InputDefinition $definition, array $options = array());
102   
103      /**
104       * Describes a Command instance.
105       *
106       * @param Command $command
107       * @param array   $options
108       *
109       * @return string|mixed
110       */
111      abstract protected function describeCommand(Command $command, array $options = array());
112   
113      /**
114       * Describes an Application instance.
115       *
116       * @param Application $application
117       * @param array       $options
118       *
119       * @return string|mixed
120       */
121      abstract protected function describeApplication(Application $application, array $options = array());
122  }
123