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

RepeatedPass.php

Zuletzt modifiziert: 09.10.2024, 12:56 - Dateigröße: 1.99 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       * @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects
 36       *
 37       * @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface
 38       */
 39      public function __construct(array $passes)
 40      {
 41          foreach ($passes as $pass) {
 42              if (!$pass instanceof RepeatablePassInterface) {
 43                  throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.');
 44              }
 45   
 46              $pass->setRepeatedPass($this);
 47          }
 48   
 49          $this->passes = $passes;
 50      }
 51   
 52      /**
 53       * Process the repeatable passes that run more than once.
 54       *
 55       * @param ContainerBuilder $container
 56       */
 57      public function process(ContainerBuilder $container)
 58      {
 59          do {
 60              $this->repeat = false;
 61              foreach ($this->passes as $pass) {
 62                  $pass->process($container);
 63              }
 64          } while ($this->repeat);
 65      }
 66   
 67      /**
 68       * Sets if the pass should repeat.
 69       */
 70      public function setRepeat()
 71      {
 72          $this->repeat = true;
 73      }
 74   
 75      /**
 76       * Returns the passes.
 77       *
 78       * @return RepeatablePassInterface[] An array of RepeatablePassInterface objects
 79       */
 80      public function getPasses()
 81      {
 82          return $this->passes;
 83      }
 84  }
 85