Skip to content

Commit

Permalink
Add generic template for Message
Browse files Browse the repository at this point in the history
  • Loading branch information
markinigor authored Nov 1, 2024
1 parent a1e464f commit 291724d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use DateTimeImmutable;
use RuntimeException;

/**
* @template TId of AggregateRootId
*/
final class Message
{
public const TIME_OF_RECORDING_FORMAT = 'Y-m-d H:i:s.uO';
Expand Down Expand Up @@ -52,6 +55,9 @@ public function aggregateVersion(): int
return (int) $version;
}

/**
* @return TId|null
*/
public function aggregateRootId(): ?AggregateRootId
{
return $this->headers[Header::AGGREGATE_ROOT_ID] ?? null;
Expand Down

0 comments on commit 291724d

Please sign in to comment.