Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit feb2cc9

Browse files
committed
Merge branch 'hotfix/270'
Close #270
2 parents a9745af + b657fcc commit feb2cc9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Proxy/LazyServiceFactory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ public function __construct(LazyLoadingValueHolderFactory $proxyFactory, array $
4949
*/
5050
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
5151
{
52-
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
53-
$proxy->setProxyInitializer(null);
54-
$wrappedInstance = $callback();
52+
if (isset($this->servicesMap[$name])) {
53+
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
54+
$proxy->setProxyInitializer(null);
55+
$wrappedInstance = $callback();
5556

56-
return true;
57-
};
57+
return true;
58+
};
5859

59-
if (isset($this->servicesMap[$name])) {
6060
return $this->proxyFactory->createProxy($this->servicesMap[$name], $initializer);
6161
}
6262

0 commit comments

Comments
 (0)