Skip to content

Commit 98653f0

Browse files
committed
The handler locator do not care about collections, they are resolved earlier
1 parent 9810a54 commit 98653f0

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

src/Symfony/Component/Message/HandlerLocator.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class HandlerLocator implements HandlerLocatorInterface
2121
{
2222
/**
2323
* Maps a message (its class) to a given handler.
24-
*
25-
* @var array
2624
*/
2725
private $messageToHandlerMapping;
2826

@@ -39,18 +37,6 @@ public function resolve($message): callable
3937
throw new NoHandlerForMessageException(sprintf('No handler for message "%s".', $messageKey));
4038
}
4139

42-
$handler = $this->messageToHandlerMapping[$messageKey];
43-
if ($this->isCollectionOfHandlers($handler)) {
44-
$handler = new ChainHandler($handler);
45-
}
46-
47-
return $handler;
48-
}
49-
50-
private function isCollectionOfHandlers($handler): bool
51-
{
52-
return is_array($handler) && array_reduce($handler, function (bool $allHandlers, $handler) {
53-
return $allHandlers && is_callable($handler);
54-
}, true);
40+
return $this->messageToHandlerMapping[$messageKey];
5541
}
5642
}

0 commit comments

Comments
 (0)