From bc052d9e289d071b14bbd7db902d3c22dba3d93f Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 2 Sep 2023 11:12:03 +0200 Subject: [PATCH] TASK: document and assert Node.nodeName behavior related https://github.com/neos/neos-development-collection/issues/4311 --- Classes/Projection/ContentGraph/Node.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Classes/Projection/ContentGraph/Node.php b/Classes/Projection/ContentGraph/Node.php index 428b6c01..96670402 100644 --- a/Classes/Projection/ContentGraph/Node.php +++ b/Classes/Projection/ContentGraph/Node.php @@ -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); + } } /**