[ Index ]

PHP Cross Reference of phpBB-3.3.14-deutsch

title

Body

[close]

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

   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace ProxyManager\ProxyGenerator\LazyLoadingGhost\MethodGenerator;
   6  
   7  use ProxyManager\Generator\MethodGenerator;
   8  use Zend\Code\Generator\MethodGenerator as ZendMethodGenerator;
   9  use Zend\Code\Generator\PropertyGenerator;
  10  
  11  /**
  12   * Implementation for {@see \ProxyManager\Proxy\LazyLoadingInterface::initializeProxy}
  13   * for lazy loading ghost objects
  14   *
  15   * @author Marco Pivetta <ocramius@gmail.com>
  16   * @license MIT
  17   */
  18  class InitializeProxy extends MethodGenerator
  19  {
  20      /**
  21       * Constructor
  22       *
  23       * @param PropertyGenerator   $initializerProperty
  24       * @param ZendMethodGenerator $callInitializer
  25       *
  26       * @throws \Zend\Code\Generator\Exception\InvalidArgumentException
  27       */
  28      public function __construct(PropertyGenerator $initializerProperty, ZendMethodGenerator $callInitializer)
  29      {
  30          parent::__construct('initializeProxy');
  31          $this->setReturnType('bool');
  32  
  33          $this->setBody(
  34              'return $this->' . $initializerProperty->getName() . ' && $this->' . $callInitializer->getName()
  35              . '(\'initializeProxy\', []);'
  36          );
  37      }
  38  }


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