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 |
MagicSleep.php
01 <?php
02
03 declare(strict_types=1);
04
05 namespace ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizer\MethodGenerator;
06
07 use ProxyManager\Generator\MagicMethodGenerator;
08 use ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizer\MethodGenerator\Util\InterceptorGenerator;
09 use ProxyManager\ProxyGenerator\Util\GetMethodIfExists;
10 use ReflectionClass;
11 use Zend\Code\Generator\PropertyGenerator;
12
13 /**
14 * Magic `__sleep` for lazy loading ghost objects
15 *
16 * @author Marco Pivetta <ocramius@gmail.com>
17 * @license MIT
18 */
19 class MagicSleep extends MagicMethodGenerator
20 {
21 /**
22 * Constructor
23 *
24 * @param ReflectionClass $originalClass
25 * @param PropertyGenerator $prefixInterceptors
26 * @param PropertyGenerator $suffixInterceptors
27 */
28 public function __construct(
29 ReflectionClass $originalClass,
30 PropertyGenerator $prefixInterceptors,
31 PropertyGenerator $suffixInterceptors
32 ) {
33 parent::__construct($originalClass, '__sleep');
34
35 $parent = GetMethodIfExists::get($originalClass, '__sleep');
36
37 $callParent = $parent ? '$returnValue = & parent::__sleep();' : '$returnValue = array_keys((array) $this);';
38
39 $this->setBody(InterceptorGenerator::createInterceptedMethodBody(
40 $callParent,
41 $this,
42 $prefixInterceptors,
43 $suffixInterceptors,
44 $parent
45 ));
46 }
47 }
48