Convert envelope trait to abstract class#231
Conversation
| return $this->metadata; | ||
| } | ||
|
|
||
| public function withMetadata(array $metadata): self |
There was a problem hiding this comment.
I don't see any real-world use cases. Do you?
There was a problem hiding this comment.
Message handlers may add metadata into the message
There was a problem hiding this comment.
They should wrap it into an envelope then.
| @@ -23,14 +20,6 @@ public function getMessage(): MessageInterface | |||
| return $this->message; | |||
| } | |||
|
|
|||
| public function withMessage(MessageInterface $message): self | |||
There was a problem hiding this comment.
I don't see any real-world use cases. Do you?
There was a problem hiding this comment.
Another question.
Why is this better than FooEnvelope::fromMessage($message) or new FooEnvelope()?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #231 +/- ##
============================================
+ Coverage 96.16% 96.47% +0.30%
+ Complexity 359 356 -3
============================================
Files 47 47
Lines 966 965 -1
============================================
+ Hits 929 931 +2
+ Misses 37 34 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vjik
left a comment
There was a problem hiding this comment.
Seems, this PR significantly degraded performance (see benchmark CI).
|
The performance concern is valid. |
| return $this->metadata; | ||
| } | ||
|
|
||
| public function withMetadata(array $metadata): self |
There was a problem hiding this comment.
Message handlers may add metadata into the message
| $this->assertSame('data', $envelope->getMetadata()['meta']); | ||
| } | ||
|
|
||
| public function testWithMessage(): void |
There was a problem hiding this comment.
Why is this better than FooEnvelope::fromMessage($message) or new FooEnvelope()?
|
@viktorprogger benchmark is looking way better now. How about merging master into the PR branch? |
# Conflicts: # src/Message/EnvelopeTrait.php # src/Message/IdEnvelope.php # src/Middleware/FailureHandling/FailureEnvelope.php # tests/Unit/Message/IdEnvelopeTest.php
…act-class # Conflicts: # phpbench.json

No description provided.