Skip to content

Commit

Permalink
Merge pull request #849 from nicolas-grekas/fix-lazy
Browse files Browse the repository at this point in the history
Fix handling of lazy entity listeners
  • Loading branch information
kimhemsoe committed Oct 30, 2018
2 parents 8cd4c29 + 321e175 commit a7c2085
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions DependencyInjection/Compiler/EntityListenerPass.php
Expand Up @@ -52,9 +52,9 @@ public function process(ContainerBuilder $container)
$this->attachToListener($container, $name, $id, $attributes);
}

if (isset($attributes['lazy']) && $attributes['lazy']) {
$listener = $container->findDefinition($id);
$listener = $container->findDefinition($id);

if ($listener->isLazy() || !empty($attributes['lazy'])) {
if ($listener->isAbstract()) {
throw new InvalidArgumentException(sprintf('The service "%s" must not be abstract as this entity listener is lazy-loaded.', $id));
}
Expand Down

0 comments on commit a7c2085

Please sign in to comment.