Skip to content

Commit

Permalink
Merge 577e293 into ebdcac8
Browse files Browse the repository at this point in the history
  • Loading branch information
tienvx committed Mar 11, 2023
2 parents ebdcac8 + 577e293 commit 3c1c006
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/Resources/config/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
use Tienvx\Bundle\PactMessengerBundle\Service\EnvelopeCollectorInterface;

return static function (ContainerConfigurator $container): void {
$namespace = __NAMESPACE__;
$service = function_exists("$namespace\\service") ? "$namespace\\service" : "$namespace\\ref";
$container->services()
->set(EnvelopeCollector::class)
->alias(EnvelopeCollectorInterface::class, EnvelopeCollector::class)

->set(SendMessageToTransportsEventListener::class)
->args([
EnvelopeCollectorInterface::class,
$service(EnvelopeCollectorInterface::class),
])
->tag('kernel.event_listener')
;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ public function testLoad(): void
],
SendMessageToTransportsEventListener::class => [
'tag' => 'kernel.event_listener',
'args' => fn (array $args) => $args === [
EnvelopeCollectorInterface::class,
],
'args' => fn (array $args) => 1 === count($args) &&
EnvelopeCollectorInterface::class == $args[0],
],
];
foreach ($services as $key => $value) {
Expand Down

0 comments on commit 3c1c006

Please sign in to comment.