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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

MagicSet.php

Zuletzt modifiziert: 02.04.2025, 15:04 - Dateigröße: 1.96 KiB


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\Util\GetMethodIfExists;
09  use Zend\Code\Generator\ParameterGenerator;
10  use ProxyManager\ProxyGenerator\AccessInterceptorScopeLocalizer\MethodGenerator\Util\InterceptorGenerator;
11  use ProxyManager\ProxyGenerator\Util\PublicScopeSimulator;
12  use ReflectionClass;
13  use Zend\Code\Generator\PropertyGenerator;
14   
15  /**
16   * Magic `__set` for lazy loading ghost objects
17   *
18   * @author Marco Pivetta <ocramius@gmail.com>
19   * @license MIT
20   */
21  class MagicSet extends MagicMethodGenerator
22  {
23      /**
24       * @param \ReflectionClass                       $originalClass
25       * @param \Zend\Code\Generator\PropertyGenerator $prefixInterceptors
26       * @param \Zend\Code\Generator\PropertyGenerator $suffixInterceptors
27       *
28       * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
29       * @throws \InvalidArgumentException
30       */
31      public function __construct(
32          ReflectionClass $originalClass,
33          PropertyGenerator $prefixInterceptors,
34          PropertyGenerator $suffixInterceptors
35      ) {
36          parent::__construct(
37              $originalClass,
38              '__set',
39              [new ParameterGenerator('name'), new ParameterGenerator('value')]
40          );
41   
42          $parent = GetMethodIfExists::get($originalClass, '__set');
43   
44          $callParent = '$returnValue = & parent::__set($name, $value);';
45   
46          if (! $parent) {
47              $callParent = PublicScopeSimulator::getPublicAccessSimulationCode(
48                  PublicScopeSimulator::OPERATION_SET,
49                  'name',
50                  'value',
51                  null,
52                  'returnValue'
53              );
54          }
55   
56          $this->setBody(InterceptorGenerator::createInterceptedMethodBody(
57              $callParent,
58              $this,
59              $prefixInterceptors,
60              $suffixInterceptors,
61              $parent
62          ));
63      }
64  }
65