diff --git a/src/Message/EnvelopeTrait.php b/src/Message/EnvelopeTrait.php index 7e58a97b..68ed313c 100644 --- a/src/Message/EnvelopeTrait.php +++ b/src/Message/EnvelopeTrait.php @@ -13,7 +13,7 @@ public function getMessage(): MessageInterface return $this->message; } - public function withMessage(MessageInterface $message): self + public function withMessage(MessageInterface $message): EnvelopeInterface { $instance = clone $this; $instance->message = $message; @@ -31,9 +31,9 @@ public function getData(): mixed return $this->message->getData(); } - public static function fromMessage(MessageInterface $message): self + public static function fromMessage(MessageInterface $message): EnvelopeInterface { - return new static($message); + return new IdEnvelope($message); } public function getMetadata(): array