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 |
CheckReferenceValidityPass.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\Definition;
15 use Symfony\Component\DependencyInjection\Exception\RuntimeException;
16 use Symfony\Component\DependencyInjection\Reference;
17
18 /**
19 * Checks the validity of references.
20 *
21 * The following checks are performed by this pass:
22 * - target definitions are not abstract
23 *
24 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
25 */
26 class CheckReferenceValidityPass extends AbstractRecursivePass
27 {
28 protected function processValue($value, $isRoot = false)
29 {
30 if ($isRoot && $value instanceof Definition && ($value->isSynthetic() || $value->isAbstract())) {
31 return $value;
32 }
33 if ($value instanceof Reference && $this->container->hasDefinition((string) $value)) {
34 $targetDefinition = $this->container->getDefinition((string) $value);
35
36 if ($targetDefinition->isAbstract()) {
37 throw new RuntimeException(sprintf('The definition "%s" has a reference to an abstract definition "%s". Abstract definitions cannot be the target of references.', $this->currentId, $value));
38 }
39 }
40
41 return parent::processValue($value, $isRoot);
42 }
43 }
44