Skip to content

Commit

Permalink
Merge pull request #1 from tienvx/fix-wrong-arguments
Browse files Browse the repository at this point in the history
Fix wrong arguments
  • Loading branch information
tienvx authored Mar 11, 2023
2 parents ebdcac8 + 577e293 commit e0268d6
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 e0268d6

Please sign in to comment.