|
| 1 | +<?php |
| 2 | + |
| 3 | +use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; |
| 4 | +use Symfony\Component\DependencyInjection\ContainerInterface; |
| 5 | +use Symfony\Component\DependencyInjection\Container; |
| 6 | +use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; |
| 7 | +use Symfony\Component\DependencyInjection\Exception\LogicException; |
| 8 | +use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
| 9 | +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; |
| 10 | + |
| 11 | +/** |
| 12 | + * Symfony_DI_PhpDumper_Test_Overriden_Getters_With_Constructor. |
| 13 | + * |
| 14 | + * This class has been auto-generated |
| 15 | + * by the Symfony Dependency Injection Component. |
| 16 | + * |
| 17 | + * @final since Symfony 3.3 |
| 18 | + */ |
| 19 | +class Symfony_DI_PhpDumper_Test_Overriden_Getters_With_Constructor extends Container |
| 20 | +{ |
| 21 | + private $parameters; |
| 22 | + private $targetDirs = array(); |
| 23 | + |
| 24 | + /** |
| 25 | + * Constructor. |
| 26 | + */ |
| 27 | + public function __construct() |
| 28 | + { |
| 29 | + $this->services = array(); |
| 30 | + $this->methodMap = array( |
| 31 | + 'baz' => 'getBazService', |
| 32 | + 'foo' => 'getFooService', |
| 33 | + ); |
| 34 | + |
| 35 | + $this->aliases = array(); |
| 36 | + } |
| 37 | + |
| 38 | + /** |
| 39 | + * {@inheritdoc} |
| 40 | + */ |
| 41 | + public function compile() |
| 42 | + { |
| 43 | + throw new LogicException('You cannot compile a dumped frozen container.'); |
| 44 | + } |
| 45 | + |
| 46 | + /** |
| 47 | + * {@inheritdoc} |
| 48 | + */ |
| 49 | + public function isFrozen() |
| 50 | + { |
| 51 | + return true; |
| 52 | + } |
| 53 | + |
| 54 | + /** |
| 55 | + * Gets the 'baz' service. |
| 56 | + * |
| 57 | + * This service is shared. |
| 58 | + * This method always returns the same instance of the service. |
| 59 | + * |
| 60 | + * @return \Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Baz A Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Baz instance |
| 61 | + */ |
| 62 | + protected function getBazService() |
| 63 | + { |
| 64 | + return $this->services['baz'] = $this->instantiateProxy(SymfonyProxy_a9f1de23b86d1fe2b860654ab2128883::class, array(), true); |
| 65 | + } |
| 66 | + |
| 67 | + /** |
| 68 | + * Gets the 'foo' service. |
| 69 | + * |
| 70 | + * This service is shared. |
| 71 | + * This method always returns the same instance of the service. |
| 72 | + * |
| 73 | + * @return \Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Foo A Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Foo instance |
| 74 | + */ |
| 75 | + protected function getFooService() |
| 76 | + { |
| 77 | + return $this->services['foo'] = new SymfonyProxy_cbcc1d1a7dc6a97b54a307ad6a012531($this); |
| 78 | + } |
| 79 | + |
| 80 | + private function instantiateProxy($class, $args, $useConstructor) |
| 81 | + { |
| 82 | + static $reflectionCache; |
| 83 | + |
| 84 | + if (null === $r = &$reflectionCache[$class]) { |
| 85 | + $r[0] = new \ReflectionClass($class); |
| 86 | + $r[1] = $r[0]->getProperty('containerg3aCmsigw5jaB68sqMSEQQ'); |
| 87 | + $r[1]->setAccessible(true); |
| 88 | + $r[2] = $r[0]->getConstructor(); |
| 89 | + } |
| 90 | + $service = $useConstructor ? $r[0]->newInstanceWithoutConstructor() : $r[0]->newInstanceArgs($args); |
| 91 | + $r[1]->setValue($service, $this); |
| 92 | + if ($r[2] && $useConstructor) { |
| 93 | + $r[2]->invokeArgs($service, $args); |
| 94 | + } |
| 95 | + |
| 96 | + return $service; |
| 97 | + } |
| 98 | +} |
| 99 | + |
| 100 | +class SymfonyProxy_a9f1de23b86d1fe2b860654ab2128883 extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Baz implements \Symfony\Component\DependencyInjection\LazyProxy\GetterProxyInterface |
| 101 | +{ |
| 102 | + private $containerg3aCmsigw5jaB68sqMSEQQ; |
| 103 | + private $gettersg3aCmsigw5jaB68sqMSEQQ; |
| 104 | + |
| 105 | + protected function getBaz() |
| 106 | + { |
| 107 | + return 'baz'; |
| 108 | + } |
| 109 | +} |
| 110 | + |
| 111 | +class SymfonyProxy_cbcc1d1a7dc6a97b54a307ad6a012531 extends \Symfony\Component\DependencyInjection\Tests\Fixtures\Container34\Foo implements \Symfony\Component\DependencyInjection\LazyProxy\GetterProxyInterface |
| 112 | +{ |
| 113 | + private $containerg3aCmsigw5jaB68sqMSEQQ; |
| 114 | + private $gettersg3aCmsigw5jaB68sqMSEQQ; |
| 115 | + |
| 116 | + public function __construct($containerg3aCmsigw5jaB68sqMSEQQ, $bar = 'bar') |
| 117 | + { |
| 118 | + $this->containerg3aCmsigw5jaB68sqMSEQQ = $containerg3aCmsigw5jaB68sqMSEQQ; |
| 119 | + parent::__construct($bar); |
| 120 | + } |
| 121 | + |
| 122 | + public function getPublic() |
| 123 | + { |
| 124 | + return 'public'; |
| 125 | + } |
| 126 | + |
| 127 | + protected function getProtected() |
| 128 | + { |
| 129 | + return 'protected'; |
| 130 | + } |
| 131 | + |
| 132 | + public function getSelf() |
| 133 | + { |
| 134 | + if (null === $g = &$this->gettersg3aCmsigw5jaB68sqMSEQQ[__FUNCTION__]) { |
| 135 | + $g = \Closure::bind(function () { return ${($_ = isset($this->services['foo']) ? $this->services['foo'] : $this->get('foo')) && false ?: '_'}; }, $this->containerg3aCmsigw5jaB68sqMSEQQ, $this->containerg3aCmsigw5jaB68sqMSEQQ); |
| 136 | + } |
| 137 | + |
| 138 | + return $g(); |
| 139 | + } |
| 140 | + |
| 141 | + public function getInvalid() |
| 142 | + { |
| 143 | + if (null === $g = &$this->gettersg3aCmsigw5jaB68sqMSEQQ[__FUNCTION__]) { |
| 144 | + $g = \Closure::bind(function () { return array(0 => $this->get('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE)); }, $this->containerg3aCmsigw5jaB68sqMSEQQ, $this->containerg3aCmsigw5jaB68sqMSEQQ); |
| 145 | + } |
| 146 | + |
| 147 | + if ($this->containerg3aCmsigw5jaB68sqMSEQQ->has('bar')) { |
| 148 | + return $g(); |
| 149 | + } |
| 150 | + |
| 151 | + return parent::getInvalid(); |
| 152 | + } |
| 153 | +} |
0 commit comments