| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | public function __invoke(ContainerInterface $container, string $name) |
||
| 33 | { |
||
| 34 | $inner = $this->inner; |
||
| 35 | |||
| 36 | $proxyFactory = new LazyLoadingValueHolderFactory(); |
||
| 37 | $initializer = function( |
||
| 38 | & $wrappedObject, |
||
| 39 | LazyLoadingInterface $proxy |
||
| 40 | ) use ($container, $inner, $name) { |
||
| 41 | $proxy->setProxyInitializer(null); |
||
| 42 | $wrappedObject = $inner($container, $name); |
||
| 43 | |||
| 44 | return true; |
||
| 45 | }; |
||
| 46 | |||
| 47 | return $proxyFactory->createProxy($this->className ?? $name, $initializer); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |