Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

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

RepeatedPass.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 2.03 KiB


 01  <?php
 02   
 03  /*
 04   * This file is part of the Symfony package.
 05   *
 06   * (c) Fabien Potencier <fabien@symfony.com>
 07   *
 08   * For the full copyright and license information, please view the LICENSE
 09   * file that was distributed with this source code.
 10   */
 11   
 12  namespace Symfony\Component\DependencyInjection\Compiler;
 13   
 14  use Symfony\Component\DependencyInjection\ContainerBuilder;
 15  use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
 16   
 17  /**
 18   * A pass that might be run repeatedly.
 19   *
 20   * @author Johannes M. Schmitt <schmittjoh@gmail.com>
 21   */
 22  class RepeatedPass implements CompilerPassInterface
 23  {
 24      /**
 25       * @var bool
 26       */
 27      private $repeat = false;
 28   
 29      /**
 30       * @var RepeatablePassInterface[]
 31       */
 32      private $passes;
 33   
 34      /**
 35       * Constructor.
 36       *
 37       * @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects
 38       *
 39       * @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface
 40       */
 41      public function __construct(array $passes)
 42      {
 43          foreach ($passes as $pass) {
 44              if (!$pass instanceof RepeatablePassInterface) {
 45                  throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.');
 46              }
 47   
 48              $pass->setRepeatedPass($this);
 49          }
 50   
 51          $this->passes = $passes;
 52      }
 53   
 54      /**
 55       * Process the repeatable passes that run more than once.
 56       *
 57       * @param ContainerBuilder $container
 58       */
 59      public function process(ContainerBuilder $container)
 60      {
 61          $this->repeat = false;
 62          foreach ($this->passes as $pass) {
 63              $pass->process($container);
 64          }
 65   
 66          if ($this->repeat) {
 67              $this->process($container);
 68          }
 69      }
 70   
 71      /**
 72       * Sets if the pass should repeat
 73       */
 74      public function setRepeat()
 75      {
 76          $this->repeat = true;
 77      }
 78   
 79      /**
 80       * Returns the passes
 81       *
 82       * @return RepeatablePassInterface[] An array of RepeatablePassInterface objects
 83       */
 84      public function getPasses()
 85      {
 86          return $this->passes;
 87      }
 88  }
 89