Skip to content

Commit

Permalink
TASK: document and assert Node.nodeName behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Sep 19, 2023
1 parent 34bc3c7 commit bc052d9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Classes/Projection/ContentGraph/Node.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,16 @@ public function __construct(
* @return PropertyCollectionInterface Property values, indexed by their name
*/
public readonly PropertyCollectionInterface $properties,
/**
* The node's name. The name is guaranteed to be for tethered nodes.
* For the regular classification, it can be set optionally.
*/
public readonly ?NodeName $nodeName,
public readonly Timestamps $timestamps,
) {
if ($this->classification->isTethered() && $this->nodeName === null) {
throw new \InvalidArgumentException('The NodeName must be set if the Node is tethered.', 1695118377232);
}
}

/**
Expand Down

0 comments on commit bc052d9

Please sign in to comment.