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 |
InitializeProxy.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator;
06
07 use ProxyManager\Generator\MethodGenerator;
08 use Zend\Code\Generator\PropertyGenerator;
09
10 /**
11 * Implementation for {@see \ProxyManager\Proxy\LazyLoadingInterface::initializeProxy}
12 * for lazy loading value holder objects
13 *
14 * @author Marco Pivetta <ocramius@gmail.com>
15 * @license MIT
16 */
17 class InitializeProxy extends MethodGenerator
18 {
19 /**
20 * Constructor
21 *
22 * @param PropertyGenerator $initializerProperty
23 * @param PropertyGenerator $valueHolderProperty
24 *
25 * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
26 */
27 public function __construct(PropertyGenerator $initializerProperty, PropertyGenerator $valueHolderProperty)
28 {
29 parent::__construct('initializeProxy');
30 $this->setReturnType('bool');
31
32 $initializer = $initializerProperty->getName();
33
34 $this->setBody(
35 'return $this->' . $initializer . ' && $this->' . $initializer
36 . '->__invoke($this->' . $valueHolderProperty->getName()
37 . ', $this, \'initializeProxy\', array(), $this->' . $initializer . ');'
38 );
39 }
40 }
41