[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 declare(strict_types=1); 4 5 namespace ProxyManager\ProxyGenerator\LazyLoadingValueHolder\MethodGenerator; 6 7 use Closure; 8 use ProxyManager\Generator\MethodGenerator; 9 use Zend\Code\Generator\ParameterGenerator; 10 use Zend\Code\Generator\PropertyGenerator; 11 12 /** 13 * Implementation for {@see \ProxyManager\Proxy\LazyLoadingInterface::setProxyInitializer} 14 * for lazy loading value holder objects 15 * 16 * @author Marco Pivetta <ocramius@gmail.com> 17 * @license MIT 18 */ 19 class SetProxyInitializer extends MethodGenerator 20 { 21 /** 22 * Constructor 23 * 24 * @param PropertyGenerator $initializerProperty 25 * 26 * @throws \Zend\Code\Generator\Exception\InvalidArgumentException 27 */ 28 public function __construct(PropertyGenerator $initializerProperty) 29 { 30 parent::__construct('setProxyInitializer'); 31 32 $initializerParameter = new ParameterGenerator('initializer'); 33 34 $initializerParameter->setType(Closure::class); 35 $initializerParameter->setDefaultValue(null); 36 $this->setParameter($initializerParameter); 37 $this->setBody('$this->' . $initializerProperty->getName() . ' = $initializer;'); 38 } 39 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |