Skip to content

Commit dfd7a5b

Browse files
[Messenger] Fix registering message handlers
1 parent c6a452d commit dfd7a5b

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)