Skip to content

Commit

Permalink
TASK: Ensure that SerializedNodeReferencesForName are serialized as…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
mhsdesign committed Oct 31, 2024
1 parent 3310d74 commit 4eee438
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@

private function __construct(
public ReferenceName $referenceName,
SerializedNodeReference ...$references
SerializedNodeReference ...$items
) {
$referencesByTarget = [];
foreach ($references as $reference) {
if (isset($referencesByTarget[$reference->targetNodeAggregateId->value])) {
throw new \InvalidArgumentException(sprintf('Duplicate entry in references to write. Target "%s" already exists in collection.', $reference->targetNodeAggregateId->value), 1700150910);
foreach ($items as $item) {
if (isset($referencesByTarget[$item->targetNodeAggregateId->value])) {
throw new \InvalidArgumentException(sprintf('Duplicate entry in references to write. Target "%s" already exists in collection.', $item->targetNodeAggregateId->value), 1700150910);
}
$referencesByTarget[$reference->targetNodeAggregateId->value] = true;
$referencesByTarget[$item->targetNodeAggregateId->value] = true;
}
$this->references = $references;
$this->references = array_values($items);
}

/**
Expand Down

0 comments on commit 4eee438

Please sign in to comment.