| Total Complexity | 4 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| 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 | 13 | public function __construct( |
|
| 15 | MessageInterface $message, |
||
| 16 | private readonly string|int|null $id = null, |
||
| 17 | ) { |
||
| 18 | 13 | parent::__construct($message); |
|
| 19 | } |
||
| 20 | |||
| 21 | 2 | public static function fromMessage(MessageInterface $message): self |
|
| 22 | { |
||
| 23 | 2 | return new self($message, $message->getMetadata()[self::MESSAGE_ID_KEY] ?? null); |
|
| 24 | } |
||
| 25 | |||
| 26 | 12 | public function getId(): string|int|null |
|
| 29 | } |
||
| 30 | |||
| 31 | 12 | protected function getEnvelopeMetadata(): array |
|
| 36 |