Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function getHandlerForMessage(object $message): callable |
||
34 | { |
||
35 | $class = $message::class; |
||
36 | $id = $this->messageToHandler[$class] |
||
37 | ?? throw new HandlerNotFound("No handler for messages of type `$class`."); |
||
38 | |||
39 | try { |
||
40 | return $this->container->get($id); // @phpstan-ignore-line |
||
41 | } catch (NotFoundExceptionInterface $e) { |
||
42 | throw new HandlerNotFound("No handler for messages of type `$class`.", $e); |
||
43 | } |
||
46 |