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

Commit b7e56ba

Browse files
committed
Merge branch 'hotfix/270' into develop
Forward port #270
2 parents aa067c9 + b657fcc commit b7e56ba

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
@@ -51,14 +51,14 @@ public function __construct(LazyLoadingValueHolderFactory $proxyFactory, array $
5151
*/
5252
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
5353
{
54-
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
55-
$proxy->setProxyInitializer(null);
56-
$wrappedInstance = $callback();
54+
if (isset($this->servicesMap[$name])) {
55+
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
56+
$proxy->setProxyInitializer(null);
57+
$wrappedInstance = $callback();
5758

58-
return true;
59-
};
59+
return true;
60+
};
6061

61-
if (isset($this->servicesMap[$name])) {
6262
return $this->proxyFactory->createProxy($this->servicesMap[$name], $initializer);
6363
}
6464

0 commit comments

Comments
 (0)