-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert envelope trait to abstract class #231
base: master
Are you sure you want to change the base?
Conversation
{ | ||
return []; | ||
} | ||
abstract protected function getEnvelopeMetadata(): array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's good to keep default empty array
@@ -37,12 +37,4 @@ public function getMetadata(): array | |||
{ | |||
return $this->metadata; | |||
} | |||
|
|||
public function withMetadata(array $metadata): self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
private MessageInterface $message, | ||
private array $meta = [], | ||
MessageInterface $message, | ||
private readonly array $failureMeta = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private readonly array $failureMeta = [], | |
private readonly array $metadata = [], |
@@ -23,14 +20,6 @@ public function getMessage(): MessageInterface | |||
return $this->message; | |||
} | |||
|
|||
public function withMessage(MessageInterface $message): self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
$meta[self::FAILURE_META_KEY] = array_merge($meta[self::FAILURE_META_KEY] ?? [], $this->meta); | ||
|
||
return $meta; | ||
return [self::FAILURE_META_KEY => ArrayHelper::merge($this->message->getMetadata()[self::FAILURE_META_KEY] ?? [], $this->failureMeta)]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as you can see getEnvelopeMetadata
method must provide all the collected metadata, not only the owned
No description provided.