[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

/vendor/ocramius/proxy-manager/src/ProxyManager/ProxyGenerator/RemoteObject/MethodGenerator/ -> MagicGet.php (source)

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace ProxyManager\ProxyGenerator\RemoteObject\MethodGenerator;
   6  
   7  use ProxyManager\Generator\MagicMethodGenerator;
   8  use Zend\Code\Generator\ParameterGenerator;
   9  use ReflectionClass;
  10  use Zend\Code\Generator\PropertyGenerator;
  11  
  12  /**
  13   * Magic `__get` for remote objects
  14   *
  15   * @author Vincent Blanchon <blanchon.vincent@gmail.com>
  16   * @license MIT
  17   */
  18  class MagicGet extends MagicMethodGenerator
  19  {
  20      /**
  21       * Constructor
  22       * @param ReflectionClass                        $originalClass
  23       * @param \Zend\Code\Generator\PropertyGenerator $adapterProperty
  24       *
  25       * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
  26       */
  27      public function __construct(ReflectionClass $originalClass, PropertyGenerator $adapterProperty)
  28      {
  29          parent::__construct($originalClass, '__get', [new ParameterGenerator('name')]);
  30  
  31          $this->setDocBlock('@param string $name');
  32          $this->setBody(
  33              '$return = $this->' . $adapterProperty->getName() . '->call(' . var_export($originalClass->getName(), true)
  34              . ', \'__get\', array($name));' . "\n\n" . 'return $return;'
  35          );
  36      }
  37  }


Generated: Mon Nov 25 19:05:08 2024 Cross-referenced by PHPXref 0.7.1