8000 feature #33113 [Messenger][DX] Display real handler if handler is wra… · symfony/symfony@b0c2112 · GitHub
[go: up one dir, main page]

Skip to content

Commit b0c2112

Browse files
committed
feature #33113 [Messenger][DX] Display real handler if handler is wrapped (DavidBadura)
This PR was merged into the 4.4 branch. Discussion ---------- [Messenger][DX] Display real handler if handler is wrapped | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | none | License | MIT | Doc PR | none Execute: ``` bin/console debug:messenger ``` Before: <img width="718" alt="Bildschirmfoto 2019-08-11 um 15 35 10" src="https://user-images.githubusercontent.com/470138/62834539-5faaa280-bc4e-11e9-99d6-a7e98822108c.png"> After: <img width="673" alt="Bildschirmfoto 2019-08-11 um 15 34 27" src="https://user-images.githubusercontent.com/470138/62834540-646f5680-bc4e-11e9-9aa7-c5fb5219204c.png"> Commits ------- e6ce9b5 display real handler if handler is wrapped
2 parents 098584a + e6ce9b5 commit b0c2112

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
7070
{
7171
$definitions = [];
7272
$handlersByBusAndMessage = [];
73+
$handlerToOriginalServiceIdMapping = [];
7374

7475
foreach ($container->findTaggedServiceIds($this->handlerTag, true) as $serviceId => $tags) {
7576
foreach ($tags as $tag) {
@@ -144,6 +145,8 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
144145
$definitionId = $serviceId;
145146
}
146147

148+
$handlerToOriginalServiceIdMapping[$definitionId] = $serviceId;
149+
147150
foreach ($buses as $handlerBus) {
148151
$handlersByBusAndMessage[$handlerBus][$message][$priority][] = [$definitionId, $options];
149152
}
@@ -193,6 +196,12 @@ private function registerHandlers(ContainerBuilder $container, array $busIds)
193196
if (!isset($debugCommandMapping[$bus])) {
194197
$debugCommandMapping[$bus] = [];
195198
}
199+
200+
foreach ($debugCommandMapping[$bus] as $message => $handlers) {
201+
foreach ($handlers as $key => $handler) {
202+
$debugCommandMapping[$bus][$message][$key][0] = $handlerToOriginalServiceIdMapping[$handler[0]];
203+
}
204+
}
196205
}
197206
$container->getDefinition('console.command.messenger_debug')->replaceArgument(0, $debugCommandMapping);
198207
}

0 commit comments

Comments
 (0)
0