| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 71.43% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | final class IdEnvelope extends AbstractEnvelope |
||
| 11 | { |
||
| 12 | public const MESSAGE_ID_KEY = 'yii-message-id'; |
||
| 13 | |||
| 14 | public function __construct( |
||
| 15 | MessageInterface $message, |
||
| 16 | 13 | private readonly string|int|null $id = null, |
|
| 17 | ) { |
||
| 18 | parent::__construct($message); |
||
| 19 | } |
||
| 20 | 13 | ||
| 21 | public static function fromMessage(MessageInterface $message): self |
||
| 22 | 2 | { |
|
| 23 | return new self($message, $message->getMetadata()[self::MESSAGE_ID_KEY] ?? null); |
||
| 24 | 2 | } |
|
| 25 | |||
| 26 | public function getId(): string|int|null |
||
| 29 | } |
||
| 30 | |||
| 31 | protected function getEnvelopeMetadata(): array |
||
| 36 |