Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
RepeatedPass.php
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 private $passes;
30
31 /**
32 * @param RepeatablePassInterface[] $passes An array of RepeatablePassInterface objects
33 *
34 * @throws InvalidArgumentException when the passes don't implement RepeatablePassInterface
35 */
36 public function __construct(array $passes)
37 {
38 foreach ($passes as $pass) {
39 if (!$pass instanceof RepeatablePassInterface) {
40 throw new InvalidArgumentException('$passes must be an array of RepeatablePassInterface.');
41 }
42
43 $pass->setRepeatedPass($this);
44 }
45
46 $this->passes = $passes;
47 }
48
49 /**
50 * Process the repeatable passes that run more than once.
51 */
52 public function process(ContainerBuilder $container)
53 {
54 do {
55 $this->repeat = false;
56 foreach ($this->passes as $pass) {
57 $pass->process($container);
58 }
59 } while ($this->repeat);
60 }
61
62 /**
63 * Sets if the pass should repeat.
64 */
65 public function setRepeat()
66 {
67 $this->repeat = true;
68 }
69
70 /**
71 * Returns the passes.
72 *
73 * @return RepeatablePassInterface[] An array of RepeatablePassInterface objects
74 */
75 public function getPasses()
76 {
77 return $this->passes;
78 }
79 }
80