Skip to content

Commit

Permalink
Fix handling of lazy entity listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas committed Sep 19, 2018
1 parent 8cd4c29 commit 321e175
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 321e175

Please sign in to comment.