From e28fc442a7c56865ee41341961cb11640309d72d Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sat, 18 May 2024 16:53:33 +0200 Subject: [PATCH] TASK: Rename `$node->nodeName` to `$node->name` --- .../Feature/NodeDuplication/Dto/NodeSubtreeSnapshot.php | 2 +- .../Classes/Projection/ContentGraph/AbsoluteNodePath.php | 4 ++-- .../ContentSubgraphWithRuntimeCaches.php | 2 +- .../Classes/FlowQueryOperations/FilterOperation.php | 2 +- .../src/Adjustment/TetheredNodeAdjustments.php | 4 ++-- .../Behavior/Features/Bootstrap/Features/NodeRenaming.php | 2 +- .../Behavior/Features/Bootstrap/ProjectedNodeTrait.php | 8 ++++---- Neos.Media.Browser/Classes/Controller/UsageController.php | 2 +- Neos.Neos/Classes/Controller/Frontend/NodeController.php | 4 ++-- .../Controller/Module/Management/WorkspacesController.php | 6 +++--- Neos.Neos/Classes/Domain/Repository/SiteRepository.php | 6 +++--- Neos.Neos/Classes/Domain/Service/SiteService.php | 4 ++-- Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php | 4 ++-- Neos.Neos/Classes/Presentation/VisualNodePath.php | 2 +- Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php | 2 +- 15 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeSubtreeSnapshot.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeSubtreeSnapshot.php index 216358c808c..2ca897bc6fc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeSubtreeSnapshot.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeSubtreeSnapshot.php @@ -55,7 +55,7 @@ public static function fromSubgraphAndStartNode(ContentSubgraphInterface $subgra return new self( $sourceNode->aggregateId, $sourceNode->nodeTypeName, - $sourceNode->nodeName, + $sourceNode->name, $sourceNode->classification, $properties->serialized(), NodeReferencesSnapshot::fromReferences( diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/AbsoluteNodePath.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/AbsoluteNodePath.php index 794a94e3f94..1579f639fbc 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/AbsoluteNodePath.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/AbsoluteNodePath.php @@ -86,14 +86,14 @@ public static function fromLeafNodeAndAncestors(Node $leafNode, Nodes $ancestors if ($ancestor->classification->isRoot()) { continue; } - if (!$ancestor->nodeName) { + if (!$ancestor->name) { throw new \InvalidArgumentException( 'Could not resolve node path for node ' . $leafNode->aggregateId->value . ', ancestor ' . $ancestor->aggregateId->value . ' is unnamed.', 1687509348 ); } - $nodeNames[] = $ancestor->nodeName; + $nodeNames[] = $ancestor->name; } return new self( diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php index 6f0a49ef84f..577ad312e92 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/ContentSubgraphWithRuntimeCaches.php @@ -90,7 +90,7 @@ public function findChildNodes(NodeAggregateId $parentNodeAggregateId, FindChild } $childNodes = $this->wrappedContentSubgraph->findChildNodes($parentNodeAggregateId, $filter); foreach ($childNodes as $node) { - $namedChildNodeCache->add($parentNodeAggregateId, $node->nodeName, $node); + $namedChildNodeCache->add($parentNodeAggregateId, $node->name, $node); $parentNodeIdCache->add($node->aggregateId, $parentNodeAggregateId); $nodeByIdCache->add($node->aggregateId, $node); } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php index 5b79de1c9da..9b1107ddef4 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php @@ -95,7 +95,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) protected function matchesPropertyNameFilter($element, $propertyNameFilter) { assert($element instanceof Node); - return $element->nodeName?->value === $propertyNameFilter; + return $element->name?->value === $propertyNameFilter; } /** diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index d3aa41be81b..213e6a59443 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -127,8 +127,8 @@ function () use ($tetheredNodeAggregate) { $actualTetheredChildNodes = []; foreach ($childNodes as $childNode) { if ($childNode->classification->isTethered()) { - assert($childNode->nodeName !== null); // it's tethered! - $actualTetheredChildNodes[$childNode->nodeName->value] = $childNode; + assert($childNode->name !== null); // it's tethered! + $actualTetheredChildNodes[$childNode->name->value] = $childNode; } } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php index 3288b58930f..ac383b6ba5b 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRenaming.php @@ -72,6 +72,6 @@ public function theCommandChangeNodeAggregateNameIsExecutedWithPayloadAndExcepti public function iExpectTheNodeToHaveTheName(string $nodeAggregateId, string $nodeName) { $node = $this->getCurrentSubgraph()->findNodeById(NodeAggregateId::fromString($nodeAggregateId)); - Assert::assertEquals($nodeName, $node->nodeName->value, 'Node Names do not match'); + Assert::assertEquals($nodeName, $node->name->value, 'Node Names do not match'); } } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php index c2f7a69c929..ad96bdacce4 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/ProjectedNodeTrait.php @@ -315,7 +315,7 @@ public function iExpectThisNodeToBeNamed(string $serializedExpectedNodeName): vo { $expectedNodeName = NodeName::fromString($serializedExpectedNodeName); $this->assertOnCurrentNode(function (Node $currentNode) use ($expectedNodeName) { - $actualNodeName = $currentNode->nodeName; + $actualNodeName = $currentNode->name; Assert::assertSame($expectedNodeName->value, $actualNodeName->value, 'Actual node name "' . $actualNodeName->value . '" does not match expected "' . $expectedNodeName->value . '"'); }); } @@ -326,7 +326,7 @@ public function iExpectThisNodeToBeNamed(string $serializedExpectedNodeName): vo public function iExpectThisNodeToBeUnnamed(): void { $this->assertOnCurrentNode(function (Node $currentNode) { - Assert::assertNull($currentNode->nodeName, 'Node was not expected to be named'); + Assert::assertNull($currentNode->name, 'Node was not expected to be named'); }); } @@ -558,7 +558,7 @@ public function iExpectThisNodeToBeTheChildOfNode(string $serializedParentNodeDi Assert::assertTrue($expectedParentDiscriminator->equals($actualParentDiscriminator), 'Parent discriminator does not match. Expected was ' . json_encode($expectedParentDiscriminator) . ', given was ' . json_encode($actualParentDiscriminator)); $expectedChildDiscriminator = NodeDiscriminator::fromNode($currentNode); - $child = $subgraph->findNodeByPath($currentNode->nodeName, $parent->aggregateId); + $child = $subgraph->findNodeByPath($currentNode->name, $parent->aggregateId); $actualChildDiscriminator = NodeDiscriminator::fromNode($child); Assert::assertTrue($expectedChildDiscriminator->equals($actualChildDiscriminator), 'Child discriminator does not match. Expected was ' . json_encode($expectedChildDiscriminator) . ', given was ' . json_encode($actualChildDiscriminator)); }); @@ -593,7 +593,7 @@ public function iExpectThisNodeToHaveTheFollowingChildNodes(TableNode $expectedC foreach ($expectedChildNodesTable->getHash() as $index => $row) { $expectedNodeName = NodeName::fromString($row['Name']); - $actualNodeName = $actualChildNodes[$index]->nodeName; + $actualNodeName = $actualChildNodes[$index]->name; Assert::assertTrue($expectedNodeName->equals($actualNodeName), 'ContentSubgraph::findChildNodes: Node name in index ' . $index . ' does not match. Expected: "' . $expectedNodeName->value . '" Actual: "' . $actualNodeName->value . '"'); if (isset($row['NodeDiscriminator'])) { $expectedNodeDiscriminator = NodeDiscriminator::fromShorthand($row['NodeDiscriminator']); diff --git a/Neos.Media.Browser/Classes/Controller/UsageController.php b/Neos.Media.Browser/Classes/Controller/UsageController.php index b41a07f5283..bde620635cb 100644 --- a/Neos.Media.Browser/Classes/Controller/UsageController.php +++ b/Neos.Media.Browser/Classes/Controller/UsageController.php @@ -152,7 +152,7 @@ public function relatedNodesAction(AssetInterface $asset) } foreach ($existingSites as $existingSite) { /** @var Site $existingSite * */ - if ($siteNode->nodeName->equals($existingSite->getNodeName()->toNodeName())) { + if ($siteNode->name->equals($existingSite->getNodeName()->toNodeName())) { $site = $existingSite; } } diff --git a/Neos.Neos/Classes/Controller/Frontend/NodeController.php b/Neos.Neos/Classes/Controller/Frontend/NodeController.php index 0bbe4077267..4fc24f62bf9 100644 --- a/Neos.Neos/Classes/Controller/Frontend/NodeController.php +++ b/Neos.Neos/Classes/Controller/Frontend/NodeController.php @@ -341,10 +341,10 @@ private static function fillCacheInternal( = $inMemoryCache->getParentNodeIdByChildNodeIdCache(); $namedChildNodeByNodeIdentifierCache = $inMemoryCache->getNamedChildNodeByNodeIdCache(); $allChildNodesByNodeIdentifierCache = $inMemoryCache->getAllChildNodesByNodeIdCache(); - if ($node->nodeName !== null) { + if ($node->name !== null) { $namedChildNodeByNodeIdentifierCache->add( $parentNode->aggregateId, - $node->nodeName, + $node->name, $node ); } else { diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index 238ccb36ae3..92f7fded383 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -778,7 +778,7 @@ protected function computeSiteChanges(Workspace $selectedWorkspace, ContentRepos $nodePathSegments = []; $documentPathSegments = []; foreach ($ancestors as $ancestor) { - $pathSegment = $ancestor->nodeName ?: NodeName::fromString($ancestor->aggregateId->value); + $pathSegment = $ancestor->name ?: NodeName::fromString($ancestor->aggregateId->value); // Don't include `sites` path as they are not needed // by the HTML/JS magic and won't be included as `$documentPathSegments` if (!$this->getNodeType($ancestor)->isOfType(NodeTypeNameFactory::NAME_SITES)) { @@ -797,8 +797,8 @@ protected function computeSiteChanges(Workspace $selectedWorkspace, ContentRepos // Neither $documentNode, $siteNode or its cannot really be null, this is just for type checks; // We should probably throw an exception though - if ($documentNode !== null && $siteNode !== null && $siteNode->nodeName) { - $siteNodeName = $siteNode->nodeName->value; + if ($documentNode !== null && $siteNode !== null && $siteNode->name) { + $siteNodeName = $siteNode->name->value; // Reverse `$documentPathSegments` to start with the site node. // The paths are used for grouping the nodes and for selecting a tree of nodes. $documentPath = implode('/', array_reverse(array_map( diff --git a/Neos.Neos/Classes/Domain/Repository/SiteRepository.php b/Neos.Neos/Classes/Domain/Repository/SiteRepository.php index d0f66098535..a70dc5074e4 100644 --- a/Neos.Neos/Classes/Domain/Repository/SiteRepository.php +++ b/Neos.Neos/Classes/Domain/Repository/SiteRepository.php @@ -124,11 +124,11 @@ public function findSiteBySiteNode(Node $siteNode): Site if (!$this->getNodeType($siteNode)->isOfType(NodeTypeNameFactory::NAME_SITE)) { throw new \Neos\Neos\Domain\Exception(sprintf('Node %s is not a site node. Site nodes must be of type "%s".', $siteNode->aggregateId->value, NodeTypeNameFactory::NAME_SITE), 1697108987); } - if ($siteNode->nodeName === null) { + if ($siteNode->name === null) { throw new \Neos\Neos\Domain\Exception(sprintf('Site node "%s" is unnamed', $siteNode->aggregateId->value), 1681286146); } - return $this->findOneByNodeName(SiteNodeName::fromNodeName($siteNode->nodeName)) - ?? throw new \Neos\Neos\Domain\Exception(sprintf('No site found for nodeNodeName "%s"', $siteNode->nodeName->value), 1677245517); + return $this->findOneByNodeName(SiteNodeName::fromNodeName($siteNode->name)) + ?? throw new \Neos\Neos\Domain\Exception(sprintf('No site found for nodeNodeName "%s"', $siteNode->name->value), 1677245517); } /** diff --git a/Neos.Neos/Classes/Domain/Service/SiteService.php b/Neos.Neos/Classes/Domain/Service/SiteService.php index 32a39458303..c437b57b219 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteService.php +++ b/Neos.Neos/Classes/Domain/Service/SiteService.php @@ -128,10 +128,10 @@ public function assignUploadedAssetToSiteAssetCollection(Asset $asset, Node $nod // should not happen return; } - if ($siteNode->nodeName === null) { + if ($siteNode->name === null) { return; } - $site = $this->siteRepository->findOneByNodeName($siteNode->nodeName->value); + $site = $this->siteRepository->findOneByNodeName($siteNode->name->value); if ($site === null) { return; } diff --git a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php index cf63385c03c..1bf6f0abf88 100644 --- a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php +++ b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php @@ -152,8 +152,8 @@ protected function resolveLabelFromNodeType(): void $this->label = $this->node->nodeTypeName->value; } - if (empty($this->postfix) && $this->node->nodeName !== null && $this->node->classification->isTethered()) { - $this->postfix = ' (' . $this->node->nodeName->value . ')'; + if (empty($this->postfix) && $this->node->name !== null && $this->node->classification->isTethered()) { + $this->postfix = ' (' . $this->node->name->value . ')'; } } diff --git a/Neos.Neos/Classes/Presentation/VisualNodePath.php b/Neos.Neos/Classes/Presentation/VisualNodePath.php index 2e0d6fb4f5d..aaeff1da893 100644 --- a/Neos.Neos/Classes/Presentation/VisualNodePath.php +++ b/Neos.Neos/Classes/Presentation/VisualNodePath.php @@ -31,7 +31,7 @@ public static function fromAncestors(Node $leafNode, Nodes $ancestors): self { $pathSegments = []; foreach ($ancestors->reverse() as $ancestor) { - $pathSegments[] = $ancestor->nodeName?->value ?: '[' . $ancestor->aggregateId->value . ']'; + $pathSegments[] = $ancestor->name?->value ?: '[' . $ancestor->aggregateId->value . ']'; } return new self('/' . implode('/', $pathSegments)); diff --git a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php index e80e4bc947c..e22ddb69521 100644 --- a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php +++ b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php @@ -44,7 +44,7 @@ public function generateUriPathSegment(?Node $node = null, ?string $text = null) { $language = null; if ($node) { - $text = $text ?: $this->nodeLabelGenerator->getLabel($node) ?: ($node->nodeName?->value ?? ''); + $text = $text ?: $this->nodeLabelGenerator->getLabel($node) ?: ($node->name?->value ?? ''); $languageDimensionValue = $node->originDimensionSpacePoint->coordinates['language'] ?? null; if (!is_null($languageDimensionValue)) { $locale = new Locale($languageDimensionValue);