Total Complexity | 5 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | final class HandlerEnvelope implements EnvelopeInterface |
||
11 | { |
||
12 | use EnvelopeTrait; |
||
13 | |||
14 | public const HANDLER_CLASS_KEY = 'handler_class'; |
||
15 | |||
16 | public function __construct( |
||
17 | private MessageInterface $message, |
||
18 | private string $handlerClass = '', |
||
19 | ) { |
||
20 | } |
||
21 | |||
22 | public function setHandler(string $handlerClass): void |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return class-string<MessageHandlerInterface> |
||
|
|||
29 | */ |
||
30 | public function getHandler(): string |
||
31 | { |
||
32 | return $this->handlerClass ?: $this->message->getMetadata()[self::HANDLER_CLASS_KEY]; |
||
33 | } |
||
34 | |||
35 | public function getEnvelopeMetadata(): array |
||
39 | ]; |
||
40 | } |
||
41 | } |
||
42 |