| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 33 | private function dispatch($message) |
||
| 34 | { |
||
| 35 | if (!class_exists(HandlerFailedException::class)) { |
||
| 36 | return $this->messageBus->dispatch($message); |
||
| 37 | } |
||
| 38 | |||
| 39 | try { |
||
| 40 | return $this->messageBus->dispatch($message); |
||
| 41 | } catch (HandlerFailedException $e) { |
||
| 42 | // unwrap the exception thrown in handler for Symfony Messenger >= 4.3 |
||
| 43 | while ($e instanceof HandlerFailedException) { |
||
| 44 | /** @var \Throwable $e */ |
||
| 45 | $e = $e->getPrevious(); |
||
| 46 | } |
||
| 47 | |||
| 48 | throw $e; |
||
| 49 | } |
||
| 52 |