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 |
LazyLoadingValueHolderGenerator.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\Bridge\ProxyManager\LazyProxy\PhpDumper;
13
14 use ProxyManager\ProxyGenerator\LazyLoadingValueHolderGenerator as BaseGenerator;
15 use Zend\Code\Generator\ClassGenerator;
16
17 /**
18 * @internal
19 */
20 class LazyLoadingValueHolderGenerator extends BaseGenerator
21 {
22 /**
23 * {@inheritdoc}
24 */
25 public function generate(\ReflectionClass $originalClass, ClassGenerator $classGenerator)
26 {
27 parent::generate($originalClass, $classGenerator);
28
29 if ($classGenerator->hasMethod('__destruct')) {
30 $destructor = $classGenerator->getMethod('__destruct');
31 $body = $destructor->getBody();
32 $newBody = preg_replace('/^(\$this->initializer[a-zA-Z0-9]++) && .*;\n\nreturn (\$this->valueHolder)/', '$1 || $2', $body);
33
34 if ($body === $newBody) {
35 throw new \UnexpectedValueException(sprintf('Unexpected lazy-proxy format generated for method "%s::__destruct()".', $originalClass->name));
36 }
37
38 $destructor->setBody($newBody);
39 }
40 }
41 }
42