Skip to content

Commit

Permalink
Merge pull request #2 from randock/feature/allowMethodOnEventListeners
Browse files Browse the repository at this point in the history
Allow method on tag for event listeners
  • Loading branch information
maks-rafalko authored Aug 11, 2017
2 parents 1e0f547 + c6e12ea commit 3d5674c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/DependencyInjection/TacticianDomainEventExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ private function addListeners(ContainerBuilder $container)
);
}

$listener = array_key_exists('method', $attributes)
? [new Reference($id), $attributes['method']]
: new Reference($id);

$definition->addMethodCall('addListener', [
$attributes['event'],
new Reference($id)
$listener
]);
}
}
Expand Down

0 comments on commit 3d5674c

Please sign in to comment.