Skip to content

Commit

Permalink
TASK: document and assert Node.nodeName behavior
Browse files Browse the repository at this point in the history
related #4311
  • Loading branch information
mhsdesign committed Nov 12, 2023
1 parent 983db91 commit 690fca4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* @param NodeTypeName $nodeTypeName The node's node type name; always set, even if unknown to the NodeTypeManager
* @param NodeType|null $nodeType The node's node type, null if unknown to the NodeTypeManager - @deprecated Don't rely on this too much, as the capabilities of the NodeType here will probably change a lot; Ask the {@see NodeTypeManager} instead
* @param PropertyCollection $properties All properties of this node. References are NOT part of this API; To access references, {@see ContentSubgraphInterface::findReferences()} can be used; To read the serialized properties, call properties->serialized().
* @param NodeName|null $nodeName The optional name of this node {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()}
* @param NodeName|null $nodeName The nodeÄs name. The name is guaranteed to be for tethered nodes. For the regular classification, it can be set optionally. One can traverse the edges via {@see ContentSubgraphInterface::findChildNodeConnectedThroughEdgeName()}.
* @param Timestamps $timestamps Creation and modification timestamps of this node
*/
private function __construct(
Expand All @@ -58,6 +58,9 @@ private function __construct(
public ?NodeName $nodeName,
public Timestamps $timestamps,
) {
if ($this->classification->isTethered() && $this->nodeName === null) {
throw new \InvalidArgumentException('The NodeName must be set if the Node is tethered.', 1695118377);
}
}

/**
Expand Down

0 comments on commit 690fca4

Please sign in to comment.