| Conditions | 3 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function __construct(MessageInterface $message) |
||
| 15 | { |
||
| 16 | $this->message = $message instanceof EnvelopeInterface ? $message->getMessage() : $message; |
||
| 17 | $this->metadata = $message->getMetadata(); |
||
| 18 | |||
| 19 | if (is_array($this->metadata[EnvelopeInterface::ENVELOPE_STACK_KEY])) { |
||
| 20 | $this->metadata[EnvelopeInterface::ENVELOPE_STACK_KEY] = array_merge( |
||
| 21 | [static::class], |
||
| 22 | array_filter( |
||
| 23 | $this->metadata[EnvelopeInterface::ENVELOPE_STACK_KEY], |
||
| 24 | static fn(string $class) => $class !== static::class, |
||
| 25 | ) |
||
| 26 | ); |
||
| 27 | } else { |
||
| 28 | $this->metadata[EnvelopeInterface::ENVELOPE_STACK_KEY] = [static::class]; |
||
| 29 | } |
||
| 62 |