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

Commit

Permalink
Merge branch 'hotfix/270'
Browse files Browse the repository at this point in the history
Close #270
  • Loading branch information
Xerkus committed Dec 20, 2018
2 parents a9745af + b657fcc commit feb2cc9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Proxy/LazyServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ public function __construct(LazyLoadingValueHolderFactory $proxyFactory, array $
*/
public function __invoke(ContainerInterface $container, $name, callable $callback, array $options = null)
{
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
$proxy->setProxyInitializer(null);
$wrappedInstance = $callback();
if (isset($this->servicesMap[$name])) {
$initializer = function (&$wrappedInstance, LazyLoadingInterface $proxy) use ($callback) {
$proxy->setProxyInitializer(null);
$wrappedInstance = $callback();

return true;
};
return true;
};

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

Expand Down

0 comments on commit feb2cc9

Please sign in to comment.