Skip to content

Commit 85ce2b6

Browse files
bug symfony#50203 [Messenger] Fix registering message handlers (nicolas-grekas)
This PR was merged into the 5.4 branch. Discussion ---------- [Messenger] Fix registering message handlers | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix symfony#50202 | License | MIT | Doc PR | - Commits ------- dfd7a5b [Messenger] Fix registering message handlers
2 parents c78f20e + dfd7a5b commit 85ce2b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Messenger/DependencyInjection/MessengerPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
143143
}
144144

145145
if ('__invoke' !== $method) {
146-
$wrapperDefinition = (new Definition('callable'))->addArgument([new Reference($serviceId), $method])->setFactory('Closure::fromCallable');
146+
$wrapperDefinition = (new Definition('Closure'))->addArgument([new Reference($serviceId), $method])->setFactory('Closure::fromCallable');
147147

148148
$definitions[$definitionId = '.messenger.method_on_object_wrapper.'.ContainerBuilder::hash($message.':'.$priority.':'.$serviceId.':'.$method)] = $wrapperDefinition;
149149
} else {

src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function testGetClassesAndMethodsAndPrioritiesFromTheSubscriber()
255255
$dummyHandlerReference = $dummyHandlerDescriptorDefinition->getArgument(0);
256256
$dummyHandlerDefinition = $container->getDefinition($dummyHandlerReference);
257257

258-
$this->assertSame('callable', $dummyHandlerDefinition->getClass());
258+
$this->assertSame('Closure', $dummyHandlerDefinition->getClass());
259259
$this->assertEquals([new Reference(HandlerMappingMethods::class), 'dummyMethod'], $dummyHandlerDefinition->getArgument(0));
260260
$this->assertSame(['Closure', 'fromCallable'], $dummyHandlerDefinition->getFactory());
261261

0 commit comments

Comments
 (0)