1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Gember\EventSourcing\UseCase; |
||
6 | |||
7 | use DateTimeImmutable; |
||
8 | |||
9 | final readonly class DomainEventEnvelope |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
10 | { |
||
11 | /** |
||
12 | * @param list<string> $domainIds |
||
13 | */ |
||
14 | 13 | public function __construct( |
|
15 | public string $eventId, |
||
16 | public array $domainIds, |
||
17 | public object $event, |
||
18 | public Metadata $metadata, |
||
19 | public DateTimeImmutable $appliedAt, |
||
20 | 13 | ) {} |
|
21 | |||
22 | 1 | public function withMetadata(Metadata $metadata): self |
|
23 | { |
||
24 | 1 | return new self( |
|
25 | 1 | $this->eventId, |
|
26 | 1 | $this->domainIds, |
|
27 | 1 | $this->event, |
|
28 | 1 | $metadata, |
|
29 | 1 | $this->appliedAt, |
|
30 | 1 | ); |
|
31 | } |
||
32 | } |
||
33 |