From 27110660a507c3d3fac760d95cf3842cebf52363 Mon Sep 17 00:00:00 2001 From: Piotr Zajac Date: Mon, 29 Nov 2021 16:24:17 +0100 Subject: [PATCH] - cs fixes --- src/AggregateRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/AggregateRepository.php b/src/AggregateRepository.php index 2f00dfc..4a88a26 100644 --- a/src/AggregateRepository.php +++ b/src/AggregateRepository.php @@ -58,6 +58,7 @@ public function saveAggregateRoot(AggregateRoot $aggregateRoot): void $streamEvents = new \ArrayIterator($events); $streamName = new StreamName($this->streamName()); + try { $this->eventStore->appendTo($streamName, $streamEvents); } catch (StreamNotFound $e) { @@ -73,7 +74,7 @@ public function getAggregateRoot(UuidInterface $aggregateId): ?AggregateRoot $metadataMatcher = new MetadataMatcher(); $aggregateType = $this->aggregateType(); $metadataMatcher = $metadataMatcher->withMetadataMatch('_aggregateType', Operator::EQUALS(), $aggregateType); - $metadataMatcher = $metadataMatcher->withMetadataMatch('_aggregateId', Operator::EQUALS(), (string) $aggregateId); + $metadataMatcher = $metadataMatcher->withMetadataMatch('_aggregateId', Operator::EQUALS(), (string)$aggregateId); try { $streamEvents = $this->eventStore->load($streamName, 1, null, $metadataMatcher);