From 291724d27d96cc09c949e31a2c08935673131772 Mon Sep 17 00:00:00 2001 From: Igor Markin Date: Fri, 1 Nov 2024 09:46:44 +0300 Subject: [PATCH] Add generic template for Message --- src/Message.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Message.php b/src/Message.php index be527cff..7f71654e 100644 --- a/src/Message.php +++ b/src/Message.php @@ -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'; @@ -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;