diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php index 4b2a0247472..a70a814bdfd 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Bootstrap/ProjectionIntegrityViolationDetectionTrait.php @@ -271,9 +271,9 @@ private function findRelationAnchorPointByIds( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'nodeAggregateId' => (string)$nodeAggregateId + 'nodeAggregateId' => $nodeAggregateId->value ] )->fetchAssociative(); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index 5598c44c7a3..ca18f566df0 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -330,7 +330,7 @@ private function whenRootNodeAggregateDimensionsWereUpdated(RootNodeAggregateDim ', [ 'parentNodeAnchor' => (string)NodeRelationAnchorPoint::forRootEdge(), 'childNodeAnchor' => (string)$rootNodeAnchorPoint, - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ]); // recreate hierarchy edges for the root node $this->connectHierarchy( @@ -387,9 +387,9 @@ private function whenNodeAggregateNameWasChanged(NodeAggregateNameWasChanged $ev n.nodeaggregateid = :nodeAggregateId and h.contentstreamid = :contentStreamId ', [ - 'newName' => (string)$event->newNodeName, - 'nodeAggregateId' => (string)$event->nodeAggregateId, - 'contentStreamId' => (string)$event->contentStreamId + 'newName' => $event->newNodeName->value, + 'nodeAggregateId' => $event->nodeAggregateId->value, + 'contentStreamId' => $event->contentStreamId->value ]); }); } @@ -418,7 +418,7 @@ private function connectRestrictionRelationsFromParentNodeToNewlyCreatedNode( r.contentstreamid, r.dimensionspacepointhash, r.originnodeaggregateid, - "' . $newlyCreatedNodeAggregateId . '" as affectednodeaggregateid + "' . $newlyCreatedNodeAggregateId->value . '" as affectednodeaggregateid FROM ' . $this->tableNamePrefix . '_restrictionrelation r WHERE @@ -426,10 +426,10 @@ private function connectRestrictionRelationsFromParentNodeToNewlyCreatedNode( and r.dimensionspacepointhash IN (:visibleDimensionSpacePoints) and r.affectednodeaggregateid = :parentNodeAggregateId ', [ - 'sourceContentStreamId' => (string)$contentStreamId, + 'sourceContentStreamId' => $contentStreamId->value, 'visibleDimensionSpacePoints' => $dimensionSpacePointsInWhichNewlyCreatedNodeAggregateIsVisible ->getPointHashes(), - 'parentNodeAggregateId' => (string)$parentNodeAggregateId + 'parentNodeAggregateId' => $parentNodeAggregateId->value ], [ 'visibleDimensionSpacePoints' => Connection::PARAM_STR_ARRAY ]); @@ -655,12 +655,12 @@ public function whenContentStreamWasForked(ContentStreamWasForked $event): void h.position, h.dimensionspacepoint, h.dimensionspacepointhash, - "' . $event->newContentStreamId . '" AS contentstreamid + "' . $event->newContentStreamId->value . '" AS contentstreamid FROM ' . $this->tableNamePrefix . '_hierarchyrelation h WHERE h.contentstreamid = :sourceContentStreamId ', [ - 'sourceContentStreamId' => (string)$event->sourceContentStreamId + 'sourceContentStreamId' => $event->sourceContentStreamId->value ]); // @@ -674,7 +674,7 @@ public function whenContentStreamWasForked(ContentStreamWasForked $event): void affectednodeaggregateid ) SELECT - "' . $event->newContentStreamId . '" AS contentstreamid, + "' . $event->newContentStreamId->value . '" AS contentstreamid, r.dimensionspacepointhash, r.originnodeaggregateid, r.affectednodeaggregateid @@ -682,7 +682,7 @@ public function whenContentStreamWasForked(ContentStreamWasForked $event): void ' . $this->tableNamePrefix . '_restrictionrelation r WHERE r.contentstreamid = :sourceContentStreamId ', [ - 'sourceContentStreamId' => (string)$event->sourceContentStreamId + 'sourceContentStreamId' => $event->sourceContentStreamId->value ]); // NOTE: as reference edges are attached to Relation Anchor Points (and they are lazily copy-on-written), @@ -700,7 +700,7 @@ public function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): voi WHERE contentstreamid = :contentStreamId ', [ - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ]); // Drop non-referenced nodes (which do not have a hierarchy relation anymore) @@ -731,7 +731,7 @@ public function whenContentStreamWasRemoved(ContentStreamWasRemoved $event): voi WHERE contentstreamid = :contentStreamId ', [ - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ]); }); } @@ -766,8 +766,8 @@ public function whenNodeReferencesWereSet(NodeReferencesWereSet $event): void throw new \InvalidArgumentException( 'Could not apply event of type "' . get_class($event) . '" since no anchor point could be resolved for node ' - . $event->getNodeAggregateId() . ' in content stream ' - . $event->getContentStreamId(), + . $event->getNodeAggregateId()->value . ' in content stream ' + . $event->getContentStreamId()->value, 1658580583 ); } @@ -867,7 +867,7 @@ private function cascadeRestrictionRelations( -- create new restriction relations... -- -------------------------------- SELECT - "' . (string)$contentStreamId . '" as contentstreamid, + "' . $contentStreamId->value . '" as contentstreamid, tree.dimensionspacepointhash, originnodeaggregateid, tree.nodeaggregateid as affectednodeaggregateid @@ -883,9 +883,9 @@ private function cascadeRestrictionRelations( ) AS joinedrestrictingancestors ', [ - 'contentStreamId' => (string)$contentStreamId, - 'parentNodeAggregateId' => (string)$parentNodeAggregateId, - 'entryNodeAggregateId' => (string)$entryNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'parentNodeAggregateId' => $parentNodeAggregateId->value, + 'entryNodeAggregateId' => $entryNodeAggregateId->value, 'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes(), 'affectedDimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes() ], @@ -1069,7 +1069,7 @@ protected function updateNodeRecordWithCopyOnWrite( [ 'newNodeAnchor' => (string)$copiedNode->relationAnchorPoint, 'originalNodeAnchor' => (string)$anchorPoint, - 'contentStreamId' => (string)$contentStreamIdWhereWriteOccurs + 'contentStreamId' => $contentStreamIdWhereWriteOccurs->value ] ); @@ -1139,7 +1139,7 @@ public function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $eve ', [ 'dimensionSpacePointHash' => $event->source->hash, - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ] ); while ($res = $rel->fetchAssociative()) { @@ -1169,7 +1169,7 @@ function (NodeRecord $nodeRecord) use ($event) { 'originalDimensionSpacePointHash' => $event->source->hash, 'newDimensionSpacePointHash' => $event->target->hash, 'newDimensionSpacePoint' => json_encode($event->target->jsonSerialize()), - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ] ); @@ -1186,7 +1186,7 @@ function (NodeRecord $nodeRecord) use ($event) { [ 'originalDimensionSpacePointHash' => $event->source->hash, 'newDimensionSpacePointHash' => $event->target->hash, - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ] ); }); @@ -1246,7 +1246,7 @@ public function whenDimensionShineThroughWasAdded(DimensionShineThroughWasAdded AND r.dimensionspacepointhash = :sourceDimensionSpacePointHash ', [ - 'contentStreamId' => (string)$event->contentStreamId, + 'contentStreamId' => $event->contentStreamId->value, 'sourceDimensionSpacePointHash' => $event->source->hash, 'targetDimensionSpacePointHash' => $event->target->hash ]); diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php index bb68b36dd67..3738af4ed91 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php @@ -68,15 +68,15 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): ) select - "' . $event->contentStreamId . '" as contentstreamid, + "' . $event->contentStreamId->value . '" as contentstreamid, dimensionspacepointhash, - "' . $event->nodeAggregateId . '" as originnodeaggregateid, + "' . $event->nodeAggregateId->value . '" as originnodeaggregateid, nodeaggregateid as affectednodeaggregateid from tree ', [ - 'entryNodeAggregateId' => (string)$event->nodeAggregateId, - 'contentStreamId' => (string)$event->contentStreamId, + 'entryNodeAggregateId' => $event->nodeAggregateId->value, + 'contentStreamId' => $event->contentStreamId->value, 'dimensionSpacePointHashes' => $event->affectedDimensionSpacePoints->getPointHashes() ], [ diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/RestrictionRelations.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/RestrictionRelations.php index 6a4ec11cec6..1e3ebed5081 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/RestrictionRelations.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/RestrictionRelations.php @@ -40,8 +40,8 @@ private function removeOutgoingRestrictionRelationsOfNodeAggregateInDimensionSpa AND r.originnodeaggregateid = :originNodeAggregateId AND r.dimensionspacepointhash in (:dimensionSpacePointHashes)', [ - 'contentStreamId' => (string)$contentStreamId, - 'originNodeAggregateId' => (string)$originNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'originNodeAggregateId' => $originNodeAggregateId->value, 'dimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes() ], [ @@ -111,8 +111,8 @@ private function removeAllRestrictionRelationsUnderneathNodeAggregate( and r.affectednodeaggregateid = tree.nodeaggregateid ', [ - 'entryNodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'entryNodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, ] ); } @@ -143,7 +143,7 @@ private function removeAllRestrictionRelationsInSubtreeImposedByAncestors( AND r.affectednodeaggregateid IN (:descendantNodeAggregateIds) AND r.dimensionspacepointhash IN (:affectedDimensionSpacePointHashes)', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'descendantNodeAggregateIds' => array_keys($descendantNodeAggregateIds), 'affectedDimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes() ], diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php index 58ddd8dc910..94de4a1f0c1 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/NodeRecord.php @@ -50,11 +50,11 @@ public function addToDatabase(Connection $databaseConnection, string $tableNameP { $databaseConnection->insert($tableNamePrefix . '_node', [ 'relationanchorpoint' => (string)$this->relationAnchorPoint, - 'nodeaggregateid' => (string)$this->nodeAggregateId, + 'nodeaggregateid' => $this->nodeAggregateId->value, 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePointHash, 'properties' => json_encode($this->properties), - 'nodetypename' => (string)$this->nodeTypeName, + 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value ]); } @@ -68,11 +68,11 @@ public function updateToDatabase(Connection $databaseConnection, string $tableNa $databaseConnection->update( $tableNamePrefix . '_node', [ - 'nodeaggregateid' => (string)$this->nodeAggregateId, + 'nodeaggregateid' => $this->nodeAggregateId->value, 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePointHash, 'properties' => json_encode($this->properties), - 'nodetypename' => (string)$this->nodeTypeName, + 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value ], [ diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php index 900b7a66ad3..e9827701b76 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/ProjectionIntegrityViolationDetector.php @@ -354,7 +354,7 @@ public function allNodesAreConnectedToARootNodePerSubgraph(): Result AND relationanchorpoint NOT IN (SELECT * FROM subgraph)', [ 'rootAnchorPoint' => NodeRelationAnchorPoint::forRootEdge(), - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAllAssociative(); @@ -365,8 +365,8 @@ public function allNodesAreConnectedToARootNodePerSubgraph(): Result }, $nodeAggregateIdsInCycles); $result->addError(new Error( - 'Subgraph defined by content strean ' . $contentStreamId - . ' and dimension space point ' . (string) $dimensionSpacePoint + 'Subgraph defined by content strean ' . $contentStreamId->value + . ' and dimension space point ' . $dimensionSpacePoint->toJson() . ' is cyclic for node aggregates ' . implode(',', $nodeAggregateIdsInCycles), self::ERROR_CODE_NODE_IS_DISCONNECTED_FROM_THE_ROOT @@ -407,7 +407,7 @@ public function nodeAggregateIdsAreUniquePerSubgraph(): Result GROUP BY n.nodeaggregateid HAVING COUNT(DISTINCT(n.relationanchorpoint)) > 1', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAllAssociative(); @@ -415,8 +415,8 @@ public function nodeAggregateIdsAreUniquePerSubgraph(): Result foreach ($ambiguousNodeAggregateRecords as $ambiguousRecord) { $result->addError(new Error( 'Node aggregate ' . $ambiguousRecord['nodeaggregateid'] - . ' is ambiguous in content stream ' . $contentStreamId - . ' and dimension space point ' . (string) $dimensionSpacePoint, + . ' is ambiguous in content stream ' . $contentStreamId->value + . ' and dimension space point ' . $dimensionSpacePoint->toJson(), self::ERROR_CODE_AMBIGUOUS_NODE_AGGREGATE_IN_SUBGRAPH )); } @@ -444,7 +444,7 @@ public function allNodesHaveAtMostOneParentPerSubgraph(): Result GROUP BY c.relationanchorpoint HAVING COUNT(DISTINCT(h.parentnodeanchor)) > 1', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAllAssociative(); @@ -452,8 +452,8 @@ public function allNodesHaveAtMostOneParentPerSubgraph(): Result foreach ($nodeRecordsWithMultipleParents as $record) { $result->addError(new Error( 'Node aggregate ' . $record['nodeaggregateid'] - . ' has multiple parents in content stream ' . $contentStreamId - . ' and dimension space point ' . (string) $dimensionSpacePoint, + . ' has multiple parents in content stream ' . $contentStreamId->value + . ' and dimension space point ' . $dimensionSpacePoint->toJson(), self::ERROR_CODE_NODE_HAS_MULTIPLE_PARENTS )); } @@ -482,15 +482,15 @@ public function nodeAggregatesAreConsistentlyTypedPerContentStream(): Result WHERE h.contentstreamid = :contentStreamId AND n.nodeaggregateid = :nodeAggregateId', [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value ] )->fetchAllAssociative(); if (count($nodeAggregateRecords) > 1) { $result->addError(new Error( - 'Node aggregate ' . $nodeAggregateId - . ' in content stream ' . $contentStreamId + 'Node aggregate ' . $nodeAggregateId->value + . ' in content stream ' . $contentStreamId->value . ' is of ambiguous type ("' . implode('","', array_map( function (array $record) { return $record['nodetypename']; @@ -525,15 +525,15 @@ public function nodeAggregatesAreConsistentlyClassifiedPerContentStream(): Resul WHERE h.contentstreamid = :contentStreamId AND n.nodeaggregateid = :nodeAggregateId', [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value ] )->fetchAllAssociative(); if (count($nodeAggregateRecords) > 1) { $result->addError(new Error( - 'Node aggregate ' . $nodeAggregateId - . ' in content stream ' . $contentStreamId + 'Node aggregate ' . $nodeAggregateId->value + . ' in content stream ' . $contentStreamId->value . ' is ambiguously classified ("' . implode('","', array_map( function (array $record) { return $record['classification']; @@ -568,14 +568,14 @@ public function childNodeCoverageIsASubsetOfParentNodeCoverage(): Result AND c.dimensionspacepointhash = p.dimensionspacepointhash AND p.childnodeanchor IS NULL', [ - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ] )->fetchAllAssociative(); foreach ($excessivelyCoveringNodeRecords as $excessivelyCoveringNodeRecord) { $result->addError(new Error( 'Node aggregate ' . $excessivelyCoveringNodeRecord['nodeaggregateid'] - . ' in content stream ' . $contentStreamId + . ' in content stream ' . $contentStreamId->value . ' covers dimension space point ' . $excessivelyCoveringNodeRecord['dimensionspacepoint'] . ' but its parent does not.', self::ERROR_CODE_CHILD_NODE_COVERAGE_IS_NO_SUBSET_OF_PARENT_NODE_COVERAGE @@ -611,7 +611,7 @@ public function allNodesCoverTheirOrigin(): Result ) AND classification != :rootClassification', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'rootClassification' => NodeAggregateClassification::CLASSIFICATION_ROOT->value ] )->fetchAllAssociative(); @@ -619,7 +619,7 @@ public function allNodesCoverTheirOrigin(): Result foreach ($nodeRecordsWithMissingOriginCoverage as $nodeRecord) { $result->addError(new Error( 'Node aggregate ' . $nodeRecord['nodeaggregateid'] - . ' in content stream ' . $contentStreamId + . ' in content stream ' . $contentStreamId->value . ' does not cover its origin dimension space point ' . $nodeRecord['origindimensionspacepoint'] . '.', self::ERROR_CODE_NODE_DOES_NOT_COVER_ITS_ORIGIN diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index de835f37d07..d8ddcb286bf 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -65,7 +65,7 @@ final public function getSubgraph( DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): ContentSubgraphInterface { - $index = $contentStreamId . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash(); + $index = $contentStreamId->value . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash(); if (!isset($this->subgraphs[$index])) { $this->subgraphs[$index] = new ContentSubgraphWithRuntimeCaches( new ContentSubgraph( @@ -104,9 +104,9 @@ public function findNodeByIdAndOriginDimensionSpacePoint( AND n.origindimensionspacepointhash = :originDimensionSpacePointHash AND h.contentstreamid = :contentStreamId', [ - 'nodeAggregateId' => (string)$nodeAggregateId, + 'nodeAggregateId' => $nodeAggregateId->value, 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ] )->fetchAssociative(); @@ -161,13 +161,13 @@ public function findRootNodeAggregates( AND h.parentnodeanchor = :rootEdgeParentAnchorId '; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'rootEdgeParentAnchorId' => (string)NodeRelationAnchorPoint::forRootEdge(), ]; if ($filter->nodeTypeName !== null) { $query .= ' AND n.nodetypename = :nodeTypeName'; - $parameters['nodeTypeName'] = (string)$filter->nodeTypeName; + $parameters['nodeTypeName'] = $filter->nodeTypeName->value; } @@ -197,8 +197,8 @@ public function findNodeAggregatesByType( AND n.nodetypename = :nodeTypeName'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeTypeName' => (string)$nodeTypeName, + 'contentStreamId' => $contentStreamId->value, + 'nodeTypeName' => $nodeTypeName->value, ]; $resultStatement = $connection->executeQuery($query, $parameters)->fetchAllAssociative(); @@ -232,8 +232,8 @@ public function findNodeAggregateById( WHERE n.nodeaggregateid = :nodeAggregateId AND h.contentstreamid = :contentStreamId'; $parameters = [ - 'nodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId + 'nodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value ]; $nodeRows = $connection->executeQuery($query, $parameters)->fetchAllAssociative(); @@ -273,8 +273,8 @@ public function findParentNodeAggregates( AND ph.contentstreamid = :contentStreamId AND ch.contentstreamid = :contentStreamId'; $parameters = [ - 'nodeAggregateId' => (string)$childNodeAggregateId, - 'contentStreamId' => (string)$contentStreamId + 'nodeAggregateId' => $childNodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value ]; $nodeRows = $connection->executeQuery($query, $parameters)->fetchAllAssociative(); @@ -321,8 +321,8 @@ public function findParentNodeAggregateByChildOriginDimensionSpacePoint( AND h.contentstreamid = :contentStreamId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'childNodeAggregateId' => (string)$childNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'childNodeAggregateId' => $childNodeAggregateId->value, 'childOriginDimensionSpacePointHash' => $childOriginDimensionSpacePoint->hash, ]; @@ -347,8 +347,8 @@ public function findChildNodeAggregates( $query = $this->createChildNodeAggregateQuery(); $parameters = [ - 'parentNodeAggregateId' => (string) $parentNodeAggregateId, - 'contentStreamId' => (string) $contentStreamId + 'parentNodeAggregateId' => $parentNodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value ]; $nodeRows = $connection->executeQuery($query, $parameters)->fetchAllAssociative(); @@ -374,9 +374,9 @@ public function findChildNodeAggregatesByName( AND ch.name = :relationName'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'parentNodeAggregateId' => (string)$parentNodeAggregateId, - 'relationName' => (string)$name + 'contentStreamId' => $contentStreamId->value, + 'parentNodeAggregateId' => $parentNodeAggregateId->value, + 'relationName' => $name->value ]; $nodeRows = $connection->executeQuery($query, $parameters)->fetchAllAssociative(); @@ -401,8 +401,8 @@ public function findTetheredChildNodeAggregates( AND c.classification = :tetheredClassification'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'parentNodeAggregateId' => (string)$parentNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'parentNodeAggregateId' => $parentNodeAggregateId->value, 'tetheredClassification' => NodeAggregateClassification::CLASSIFICATION_TETHERED->value ]; @@ -467,11 +467,11 @@ public function getDimensionSpacePointsOccupiedByChildNodeName( AND h.dimensionspacepointhash IN (:dimensionSpacePointHashes) AND h.name = :nodeName'; $parameters = [ - 'parentNodeAggregateId' => (string)$parentNodeAggregateId, + 'parentNodeAggregateId' => $parentNodeAggregateId->value, 'parentNodeOriginDimensionSpacePointHash' => $parentNodeOriginDimensionSpacePoint->hash, - 'contentStreamId' => (string) $contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHashes' => $dimensionSpacePointsToCheck->getPointHashes(), - 'nodeName' => (string) $nodeName + 'nodeName' => $nodeName->value ]; $types = [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index bb2a508ebba..8b762eea373 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -207,7 +207,7 @@ public function findChildNodeConnectedThroughEdgeName(NodeAggregateId $parentNod ->where('pn.nodeaggregateid = :parentNodeAggregateId')->setParameter('parentNodeAggregateId', $parentNodeAggregateId->value) ->andWhere('h.contentstreamid = :contentStreamId')->setParameter('contentStreamId', $this->contentStreamId->value) ->andWhere('h.dimensionspacepointhash = :dimensionSpacePointHash')->setParameter('dimensionSpacePointHash', $this->dimensionSpacePoint->hash) - ->andWhere('h.name = :edgeName')->setParameter('edgeName', (string)$edgeName); + ->andWhere('h.name = :edgeName')->setParameter('edgeName', $edgeName->value); $this->addRestrictionRelationConstraints($queryBuilder, 'cn'); return $this->fetchNode($queryBuilder); } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php index 33c02d07702..533b28c46cb 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ProjectionContentGraph.php @@ -63,8 +63,8 @@ public function findParentNode( ?DimensionSpacePoint $coveredDimensionSpacePoint = null ): ?NodeRecord { $params = [ - 'contentStreamId' => (string)$contentStreamId, - 'childNodeAggregateId' => (string)$childNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'childNodeAggregateId' => $childNodeAggregateId->value, 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, 'coveredDimensionSpacePointHash' => $coveredDimensionSpacePoint ? $coveredDimensionSpacePoint->hash @@ -107,8 +107,8 @@ public function findNodeInAggregate( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value, 'dimensionSpacePointHash' => $coveredDimensionSpacePoint->hash ] )->fetchAssociative(); @@ -135,8 +135,8 @@ public function findNodeByIds( AND n.origindimensionspacepointhash = :originDimensionSpacePointHash AND h.contentstreamid = :contentStreamId', [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value, 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash ] )->fetchAssociative(); @@ -163,9 +163,9 @@ public function getAnchorPointForNodeAndOriginDimensionSpacePointAndContentStrea AND n.origindimensionspacepointhash = :originDimensionSpacePointHash AND h.contentstreamid = :contentStreamId', [ - 'nodeAggregateId' => (string)$nodeAggregateId, + 'nodeAggregateId' => $nodeAggregateId->value, 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, ] )->fetchAllAssociative(); @@ -198,8 +198,8 @@ public function getAnchorPointsForNodeAggregateInContentStream( WHERE n.nodeaggregateid = :nodeAggregateId AND h.contentstreamid = :contentStreamId', [ - 'nodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'nodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, ] )->fetchAllAssociative(); @@ -258,7 +258,7 @@ public function determineHierarchyRelationPosition( AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ 'succeedingSiblingAnchorPoint' => (string)$succeedingSiblingAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAssociative(); @@ -274,7 +274,7 @@ public function determineHierarchyRelationPosition( AND h.position < :position', [ 'anchorPoint' => $parentAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, 'position' => $succeedingSiblingPosition ] @@ -299,7 +299,7 @@ public function determineHierarchyRelationPosition( AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ 'childAnchorPoint' => $childAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAssociative(); @@ -314,7 +314,7 @@ public function determineHierarchyRelationPosition( AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ 'parentAnchorPoint' => $parentAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAssociative(); @@ -351,7 +351,7 @@ public function getOutgoingHierarchyRelationsForNodeAndSubgraph( AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ 'parentAnchorPoint' => (string)$parentAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAllAssociative() as $relationData @@ -383,7 +383,7 @@ public function getIngoingHierarchyRelationsForNodeAndSubgraph( AND h.dimensionspacepointhash = :dimensionSpacePointHash', [ 'childAnchorPoint' => (string)$childAnchorPoint, - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ] )->fetchAllAssociative() as $relationData @@ -412,7 +412,7 @@ public function findIngoingHierarchyRelationsForNode( AND h.contentstreamid = :contentStreamId'; $parameters = [ 'childAnchorPoint' => (string)$childAnchorPoint, - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ]; $types = []; @@ -450,7 +450,7 @@ public function findOutgoingHierarchyRelationsForNode( AND h.contentstreamid = :contentStreamId'; $parameters = [ 'parentAnchorPoint' => (string)$parentAnchorPoint, - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ]; $types = []; @@ -491,8 +491,8 @@ public function findOutgoingHierarchyRelationsForNodeAggregate( AND h.contentstreamid = :contentStreamId AND h.dimensionspacepointhash IN (:dimensionSpacePointHashes)', [ - 'nodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'nodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHashes' => $dimensionSpacePointSet->getPointHashes() ], [ @@ -525,8 +525,8 @@ public function findIngoingHierarchyRelationsForNodeAggregate( WHERE n.nodeaggregateid = :nodeAggregateId AND h.contentstreamid = :contentStreamId'; $parameters = [ - 'nodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'nodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, ]; $types = []; @@ -626,8 +626,8 @@ public function findDescendantNodeAggregateIds( select nodeaggregateid, dimensionspacepointhash from nestedNodes ', [ - 'entryNodeAggregateId' => (string)$entryNodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'entryNodeAggregateId' => $entryNodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, 'affectedDimensionSpacePointHashes' => $affectedDimensionSpacePoints->getPointHashes() ], [ diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/ContentStreamForking.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/ContentStreamForking.php index bcebb2c61ae..2c51f597241 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/ContentStreamForking.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/ContentStreamForking.php @@ -33,8 +33,8 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void { $this->transactional(function () use ($event) { $parameters = [ - 'sourceContentStreamId' => (string)$event->sourceContentStreamId, - 'targetContentStreamId' => (string)$event->newContentStreamId + 'sourceContentStreamId' => $event->sourceContentStreamId->value, + 'targetContentStreamId' => $event->newContentStreamId->value ]; $this->getDatabaseConnection()->executeQuery(/** @lang PostgreSQL */ diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php index e246437a214..d954c05c068 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeVariation.php @@ -246,9 +246,9 @@ protected function replaceNodeRelationAnchorPoint( AND n.nodeaggregateid = :affectedNodeAggregateId )'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'newNodeRelationAnchorPoint' => (string)$newNodeRelationAnchorPoint, - 'affectedNodeAggregateId' => (string)$affectedNodeAggregateId + 'affectedNodeAggregateId' => $affectedNodeAggregateId->value ]; foreach ($affectedDimensionSpacePointSet as $affectedDimensionSpacePoint) { $parentStatement = /** @lang PostgreSQL */ diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php index 4392069ba6a..f10278a91e8 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HierarchyHyperrelationRecord.php @@ -168,7 +168,7 @@ public function removeFromDatabase(Connection $databaseConnection, string $table public function getDatabaseIdentifier(): array { return [ - 'contentstreamid' => (string)$this->contentStreamId, + 'contentstreamid' => $this->contentStreamId->value, 'parentnodeanchor' => (string)$this->parentNodeAnchor, 'dimensionspacepointhash' => $this->dimensionSpacePoint->hash ]; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php index ae8bf47ad1e..18257ab8eee 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeAggregateIds.php @@ -48,7 +48,7 @@ public static function fromArray(array $array): self if (is_string($item)) { $values[$item] = NodeAggregateId::fromString($item); } elseif ($item instanceof NodeAggregateId) { - $values[(string)$item] = $item; + $values[$item->value] = $item; } else { throw new \InvalidArgumentException( 'NodeAggregateIds can only consist of ' @@ -88,7 +88,7 @@ public function add( $pivot = (int)array_search($succeedingSibling, $nodeAggregateIds); array_splice($nodeAggregateIds, $pivot, 0, $nodeAggregateId); } else { - $nodeAggregateIds[(string)$nodeAggregateId] = $nodeAggregateId; + $nodeAggregateIds[$nodeAggregateId->value] = $nodeAggregateId; } return new self($nodeAggregateIds); @@ -97,8 +97,8 @@ public function add( public function remove(NodeAggregateId $nodeAggregateId): self { $identifiers = $this->ids; - if (isset($identifiers[(string) $nodeAggregateId])) { - unset($identifiers[(string) $nodeAggregateId]); + if (isset($identifiers[$nodeAggregateId->value])) { + unset($identifiers[$nodeAggregateId->value]); } return new self($identifiers); diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php index ec03af82c69..865d37e8a8b 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/NodeRecord.php @@ -93,11 +93,11 @@ public function addToDatabase(Connection $databaseConnection, string $tableNameP 'relationanchorpoint' => (string) $this->relationAnchorPoint, 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePoint->hash, - 'nodeaggregateid' => (string) $this->nodeAggregateId, - 'nodetypename' => (string) $this->nodeTypeName, + 'nodeaggregateid' => $this->nodeAggregateId->value, + 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value, 'properties' => json_encode($this->properties), - 'nodename' => (string) $this->nodeName + 'nodename' => $this->nodeName->value ]); } @@ -111,11 +111,11 @@ public function updateToDatabase(Connection $databaseConnection, string $tableNa [ 'origindimensionspacepoint' => json_encode($this->originDimensionSpacePoint), 'origindimensionspacepointhash' => $this->originDimensionSpacePoint->hash, - 'nodeaggregateid' => (string) $this->nodeAggregateId, - 'nodetypename' => (string) $this->nodeTypeName, + 'nodeaggregateid' => $this->nodeAggregateId->value, + 'nodetypename' => $this->nodeTypeName->value, 'classification' => $this->classification->value, 'properties' => json_encode($this->properties), - 'nodename' => (string) $this->nodeName, + 'nodename' => $this->nodeName->value, ], [ 'relationanchorpoint' => $this->relationAnchorPoint diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php index 5d71ac3ee98..30184174c08 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ProjectionHypergraph.php @@ -115,9 +115,9 @@ public function findParentNodeRecordByOrigin( AND n.nodeaggregateid = :childNodeAggregateId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'originDimensionSpacePointHash' => $originDimensionSpacePoint->hash, - 'childNodeAggregateId' => (string)$childNodeAggregateId + 'childNodeAggregateId' => $childNodeAggregateId->value ]; $result = $this->getDatabaseConnection() @@ -168,9 +168,9 @@ public function findParentNodeRecordByCoverage( AND n.nodeaggregateid = :childNodeAggregateId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'coveredDimensionSpacePointHash' => $coveredDimensionSpacePoint->hash, - 'childNodeAggregateId' => (string)$childNodeAggregateId + 'childNodeAggregateId' => $childNodeAggregateId->value ]; $result = $this->getDatabaseConnection() @@ -214,7 +214,7 @@ public function findIngoingHierarchyHyperrelationRecords( WHERE h.contentstreamid = :contentStreamId AND :childNodeAnchor = ANY(h.childnodeanchors)'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'childNodeAnchor' => (string)$childNodeAnchor ]; $types = []; @@ -249,7 +249,7 @@ public function findOutgoingHierarchyHyperrelationRecords( WHERE h.contentstreamid = :contentStreamId AND h.parentnodeanchor = :parentNodeAnchor'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'parentNodeAnchor' => (string)$parentNodeAnchor ]; $types = []; @@ -310,7 +310,7 @@ public function findHierarchyHyperrelationRecordByParentNodeAnchor( AND h.parentnodeanchor = :parentNodeAnchor'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, 'parentNodeAnchor' => (string)$parentNodeAnchor ]; @@ -337,7 +337,7 @@ public function findHierarchyHyperrelationRecordByChildNodeAnchor( AND :childNodeAnchor = ANY(h.childnodeanchors)'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, 'childNodeAnchor' => (string)$childNodeAnchor ]; @@ -391,8 +391,8 @@ public function findChildHierarchyHyperrelationRecord( AND h.dimensionspacepointhash = :dimensionSpacePointHash'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash ]; @@ -419,7 +419,7 @@ public function findCoverageByNodeRelationAnchorPoint( WHERE h.contentstreamid = :contentStreamId AND n.relationanchorpoint = :relationAnchorPoint'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'relationanchorpoint' => (string)$nodeRelationAnchorPoint ]; @@ -449,8 +449,8 @@ public function findCoverageByNodeAggregateId( WHERE h.contentstreamid = :contentStreamId AND n.nodeaggregateid = :nodeAggregateId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'nodeAggregateId' => (string)$nodeAggregateId + 'contentStreamId' => $contentStreamId->value, + 'nodeAggregateId' => $nodeAggregateId->value ]; $dimensionSpacePoints = []; @@ -482,9 +482,9 @@ public function findOutgoingRestrictionRelations( AND r.originnodeaggregateid = :originNodeAggregateId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHashes' => $dimensionSpacePoints->getPointHashes(), - 'originNodeAggregateId' => (string)$originNodeAggregateId + 'originNodeAggregateId' => $originNodeAggregateId->value ]; $types = [ 'dimensionSpacePointHashes' => Connection::PARAM_STR_ARRAY @@ -519,9 +519,9 @@ public function findIngoingRestrictionRelations( AND :nodeAggregateId = ANY(r.affectednodeaggregateids)'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'nodeAggregateId' => (string)$nodeAggregateId + 'nodeAggregateId' => $nodeAggregateId->value ]; $restrictionRelations = []; @@ -583,8 +583,8 @@ public function findDescendantNodeAggregateIds( SELECT nodeaggregateid, dimensionspacepointhash from descendantNodes'; $parameters = [ - 'entryNodeAggregateId' => (string)$nodeAggregateId, - 'contentStreamId' => (string)$contentStreamId, + 'entryNodeAggregateId' => $nodeAggregateId->value, + 'contentStreamId' => $contentStreamId->value, 'affectedDimensionSpacePointHashes' => $dimensionSpacePoints->getPointHashes() ]; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php index 62f0bc566e4..53c1efacd45 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Query/ProjectionHypergraphQuery.php @@ -60,7 +60,7 @@ public static function create(ContentStreamId $contentStreamId, string $tableNam WHERE h.contentstreamid = :contentStreamId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ]; return new self($query, $parameters, []); @@ -108,7 +108,7 @@ public function withNodeAggregateId(NodeAggregateId $nodeAggregateId): self AND n.nodeaggregateid = :nodeAggregateId'; $parameters = $this->parameters; - $parameters['nodeAggregateId'] = (string)$nodeAggregateId; + $parameters['nodeAggregateId'] = $nodeAggregateId->value; return new self($query, $parameters, $this->types); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php index 5952daaaed1..28331cf501d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/ReferenceRelationRecord.php @@ -59,12 +59,12 @@ public function addToDatabase(Connection $databaseConnection, string $tableNameP { $databaseConnection->insert($tableNamePrefix . '_referencerelation', [ 'sourcenodeanchor' => (string)$this->sourceNodeAnchor, - 'name' => (string)$this->name, + 'name' => $this->name->value, 'position' => $this->position, 'properties' => $this->properties ? \json_encode($this->properties) : null, - 'targetnodeaggregateid' => (string)$this->targetNodeAggregateId + 'targetnodeaggregateid' => $this->targetNodeAggregateId->value ]); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php index 6ea7ab18535..345657cd38c 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/RestrictionHyperrelationRecord.php @@ -110,9 +110,9 @@ public function addToDatabase(Connection $databaseConnection, string $tableNameP ) VALUES (?, ?, ?, ?) ON CONFLICT DO NOTHING', [ - (string)$this->contentStreamId, + $this->contentStreamId->value, $this->dimensionSpacePointHash, - (string)$this->originNodeAggregateId, + $this->originNodeAggregateId->value, $this->affectedNodeAggregateIds->toDatabaseString() ] ); @@ -150,9 +150,9 @@ public function removeFromDatabase(Connection $databaseConnection, string $table public function getDatabaseIdentifier(): array { return [ - 'contentstreamid' => (string)$this->contentStreamId, + 'contentstreamid' => $this->contentStreamId->value, 'dimensionspacepointhash' => $this->dimensionSpacePointHash, - 'originnodeaggregateid' => (string)$this->originNodeAggregateId + 'originnodeaggregateid' => $this->originNodeAggregateId->value ]; } } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php index 5659a4ed76f..37e130ad292 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentHypergraph.php @@ -70,7 +70,7 @@ public function getSubgraph( DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): ContentSubgraphInterface { - $index = $contentStreamId . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash(); + $index = $contentStreamId->value . '-' . $dimensionSpacePoint->hash . '-' . $visibilityConstraints->getHash(); if (!isset($this->subhypergraphs[$index])) { $this->subhypergraphs[$index] = new ContentSubhypergraph( $contentStreamId, @@ -189,8 +189,8 @@ public function findParentNodeAggregateByChildOriginDimensionSpacePoint( AND ch.contentstreamid = :contentStreamId )'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'childNodeAggregateId' => (string)$childNodeAggregateId, + 'contentStreamId' => $contentStreamId->value, + 'childNodeAggregateId' => $childNodeAggregateId->value, 'childOriginDimensionSpacePointHash' => $childOriginDimensionSpacePoint->hash ]; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php index 7c46f2098d5..21a556b3027 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/ContentSubhypergraph.php @@ -340,7 +340,7 @@ public function findSubtree( ): ?Subtree { $parameters = [ 'entryNodeAggregateId' => $entryNodeAggregateId->value, - 'contentStreamId' => (string)$this->contentStreamId, + 'contentStreamId' => $this->contentStreamId->value, 'dimensionSpacePointHash' => $this->dimensionSpacePoint->hash, 'maximumLevels' => $filter->maximumLevels ]; @@ -448,7 +448,7 @@ public function countNodes(): int AND h.dimensionspacepointhash = :dimensionSpacePointHash'; $parameters = [ - 'contentStreamId' => (string)$this->contentStreamId, + 'contentStreamId' => $this->contentStreamId->value, 'dimensionSpacePointHash' => $this->dimensionSpacePoint->hash ]; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphChildQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphChildQuery.php index 2c723259c4a..81ff62f6206 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphChildQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphChildQuery.php @@ -58,8 +58,8 @@ public static function create( AND pn.nodeaggregateid = :parentNodeAggregateId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, - 'parentNodeAggregateId' => (string)$parentNodeAggregateId + 'contentStreamId' => $contentStreamId->value, + 'parentNodeAggregateId' => $parentNodeAggregateId->value ]; return new self($query, $parameters, $tableNamePrefix); @@ -106,7 +106,7 @@ public function withChildNodeName(NodeName $childNodeName): self AND cn.nodename = :childNodeName'; $parameters = $this->parameters; - $parameters['childNodeName'] = (string)$childNodeName; + $parameters['childNodeName'] = $childNodeName->value; return new self($query, $parameters, $this->tableNamePrefix, $this->types); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphParentQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphParentQuery.php index 7470f87b11a..d94a9da563f 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphParentQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphParentQuery.php @@ -50,7 +50,7 @@ public static function create( AND ch.contentstreamid = :contentStreamId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ]; return new self($query, $parameters, $tableNamePrefix); @@ -62,7 +62,7 @@ public function withChildNodeAggregateId(NodeAggregateId $nodeAggregateId): self AND cn.nodeaggregateid = :nodeAggregateId'; $parameters = $this->parameters; - $parameters['nodeAggregateId'] = (string)$nodeAggregateId; + $parameters['nodeAggregateId'] = $nodeAggregateId->value; return new self($query, $parameters, $this->tableNamePrefix); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQuery.php index fb2f121b733..18f6ad6f787 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphQuery.php @@ -53,7 +53,7 @@ public static function create( WHERE h.contentstreamid = :contentStreamId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId + 'contentStreamId' => $contentStreamId->value ]; return new self($query, $parameters, $tableNamePrefix); @@ -87,7 +87,7 @@ public function withNodeAggregateId(NodeAggregateId $nodeAggregateId): self AND n.nodeaggregateid = :nodeAggregateId'; $parameters = $this->parameters; - $parameters['nodeAggregateId'] = (string)$nodeAggregateId; + $parameters['nodeAggregateId'] = $nodeAggregateId->value; return new self($query, $parameters, $this->tableNamePrefix); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphReferenceQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphReferenceQuery.php index 5ebf4884461..fd65183ea32 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphReferenceQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphReferenceQuery.php @@ -48,7 +48,7 @@ public static function create( WHERE srch.contentstreamid = :contentStreamId AND tarh.contentstreamid = :contentStreamId'; $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, ]; return new self( @@ -78,7 +78,7 @@ public function withSourceNodeAggregateId(NodeAggregateId $sourceNodeAggregateId AND srcn.nodeaggregateid = :sourceNodeAggregateId'; $parameters = $this->parameters; - $parameters['sourceNodeAggregateId'] = (string)$sourceNodeAggregateId; + $parameters['sourceNodeAggregateId'] = $sourceNodeAggregateId->value; return new self($query, $parameters, $this->tableNamePrefix, $this->types); } @@ -91,7 +91,7 @@ public function withTargetNodeAggregateId( AND tarn.nodeaggregateid = :targetNodeAggregateId'; $parameters = $this->parameters; - $parameters['targetNodeAggregateId'] = (string)$targetNodeAggregateId; + $parameters['targetNodeAggregateId'] = $targetNodeAggregateId->value; return new self($query, $parameters, $this->tableNamePrefix, $this->types); } @@ -103,7 +103,7 @@ public function withReferenceName(ReferenceName $referenceName): self AND r.name = :referenceName'; $parameters = $this->parameters; - $parameters['referenceName'] = (string)$referenceName; + $parameters['referenceName'] = $referenceName->value; return new self($query, $parameters, $this->tableNamePrefix, $this->types); } diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphSiblingQuery.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphSiblingQuery.php index d760a7f1add..f8ee802963d 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphSiblingQuery.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Repository/Query/HypergraphSiblingQuery.php @@ -46,9 +46,9 @@ public static function create( . $queryMode->renderCondition(); $parameters = [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'nodeAggregateId' => (string)$nodeAggregateId + 'nodeAggregateId' => $nodeAggregateId->value ]; return new self($query, $parameters, $tableNamePrefix); diff --git a/Neos.ContentRepository.Core/Classes/Dimension/ConfigurationBasedContentDimensionSource.php b/Neos.ContentRepository.Core/Classes/Dimension/ConfigurationBasedContentDimensionSource.php index 7434732d151..c353386def1 100644 --- a/Neos.ContentRepository.Core/Classes/Dimension/ConfigurationBasedContentDimensionSource.php +++ b/Neos.ContentRepository.Core/Classes/Dimension/ConfigurationBasedContentDimensionSource.php @@ -180,7 +180,7 @@ public function getDimension(ContentDimensionId $dimensionId): ?ContentDimension $this->initializeDimensions(); } - return $this->contentDimensions[(string)$dimensionId] ?? null; + return $this->contentDimensions[$dimensionId->value] ?? null; } /** diff --git a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimension.php b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimension.php index a05061b6a6c..f6cbeae7650 100644 --- a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimension.php +++ b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimension.php @@ -56,8 +56,8 @@ public function __construct( $generalizations = []; $specializations = []; foreach ($variationEdges as $variationEdge) { - $generalizations[(string)$variationEdge->specialization] = $variationEdge->generalization; - $specializations[(string)$variationEdge->generalization][(string)$variationEdge->specialization] + $generalizations[$variationEdge->specialization->value] = $variationEdge->generalization; + $specializations[$variationEdge->generalization->value][$variationEdge->specialization->value] = $variationEdge->specialization; } $this->generalizations = $generalizations; @@ -84,7 +84,7 @@ public function getRootValues(): array public function getGeneralization(ContentDimensionValue $dimensionValue): ?ContentDimensionValue { - return $this->generalizations[(string)$dimensionValue] ?? null; + return $this->generalizations[$dimensionValue->value] ?? null; } /** @@ -92,7 +92,7 @@ public function getGeneralization(ContentDimensionValue $dimensionValue): ?Conte */ public function getSpecializations(ContentDimensionValue $dimensionValue): array { - return $this->specializations[(string)$dimensionValue] ?? []; + return $this->specializations[$dimensionValue->value] ?? []; } /** diff --git a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraintSet.php b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraintSet.php index 57bf441e722..70c2786f751 100644 --- a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraintSet.php +++ b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraintSet.php @@ -65,15 +65,15 @@ public function getIterator(): \ArrayIterator public function getConstraints(ContentDimensionId $dimensionId): ?ContentDimensionConstraints { - return $this->constraints[(string)$dimensionId] ?? null; + return $this->constraints[$dimensionId->value] ?? null; } public function allowsCombinationWith( ContentDimensionId $contentDimensionId, ContentDimensionValue $contentDimensionValue ): bool { - return isset($this->constraints[(string)$contentDimensionId]) - ? $this->constraints[(string)$contentDimensionId]->allowsCombinationWith($contentDimensionValue) + return isset($this->constraints[$contentDimensionId->value]) + ? $this->constraints[$contentDimensionId->value]->allowsCombinationWith($contentDimensionValue) : true; } } diff --git a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraints.php b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraints.php index 60bb3e2cbb3..0ae753c8247 100644 --- a/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraints.php +++ b/Neos.ContentRepository.Core/Classes/Dimension/ContentDimensionConstraints.php @@ -41,6 +41,6 @@ public function __construct( public function allowsCombinationWith(ContentDimensionValue $dimensionValue): bool { - return $this->identifierRestrictions[(string)$dimensionValue] ?? $this->isWildcardAllowed; + return $this->identifierRestrictions[$dimensionValue->value] ?? $this->isWildcardAllowed; } } diff --git a/Neos.ContentRepository.Core/Classes/Dimension/Exception/GeneralizationIsInvalid.php b/Neos.ContentRepository.Core/Classes/Dimension/Exception/GeneralizationIsInvalid.php index 0725a1bc68f..1559312416d 100644 --- a/Neos.ContentRepository.Core/Classes/Dimension/Exception/GeneralizationIsInvalid.php +++ b/Neos.ContentRepository.Core/Classes/Dimension/Exception/GeneralizationIsInvalid.php @@ -29,8 +29,8 @@ public static function becauseComparedValueIsNoSpecialization( ContentDimensionId $dimensionId ): self { return new self( - '"' . $comparedValue . '" is no specialization of "' . $value - . '" in dimension "' . $dimensionId . '".' + '"' . $comparedValue->value . '" is no specialization of "' . $value->value + . '" in dimension "' . $dimensionId->value . '".' ); } } diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php index 9c92a2c4e31..8d03f3624d0 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/AbstractDimensionSpacePoint.php @@ -89,28 +89,28 @@ final public function isDirectVariantInDimension( return false; } if ( - $this->coordinates[(string)$contentDimensionId] - === $other->coordinates[(string)$contentDimensionId] + $this->coordinates[$contentDimensionId->value] + === $other->coordinates[$contentDimensionId->value] ) { return false; } $theseCoordinates = $this->coordinates; $otherCoordinates = $other->coordinates; - unset($theseCoordinates[(string)$contentDimensionId]); - unset($otherCoordinates[(string)$contentDimensionId]); + unset($theseCoordinates[$contentDimensionId->value]); + unset($otherCoordinates[$contentDimensionId->value]); return $theseCoordinates === $otherCoordinates; } final public function hasCoordinate(Dimension\ContentDimensionId $dimensionId): bool { - return isset($this->coordinates[(string)$dimensionId]); + return isset($this->coordinates[$dimensionId->value]); } final public function getCoordinate(Dimension\ContentDimensionId $dimensionId): ?string { - return $this->coordinates[(string)$dimensionId] ?? null; + return $this->coordinates[$dimensionId->value] ?? null; } /** diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentDimensionZookeeper.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentDimensionZookeeper.php index 9e1bcc32a8e..b8291bf08cc 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentDimensionZookeeper.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentDimensionZookeeper.php @@ -44,7 +44,7 @@ protected function initializeAllowedCombinations(): void assert($contentDimension instanceof Dimension\ContentDimension); if ($dimensionCombinations === []) { foreach ($contentDimension->values as $serializedValue => $dimensionValue) { - $dimensionCombinations[] = [(string)$contentDimension->id => $dimensionValue]; + $dimensionCombinations[] = [$contentDimension->id->value => $dimensionValue]; } } else { $this->extendCombinationsWithDimension($dimensionCombinations, $contentDimension); @@ -82,7 +82,7 @@ protected function extendCombinationsWithDimension( } } $newDimensionCombination = $dimensionCombination; - $newDimensionCombination[(string)$contentDimension->id] = $currentDimensionValue; + $newDimensionCombination[$contentDimension->id->value] = $currentDimensionValue; $currentDimensionCombinations[] = $newDimensionCombination; } } @@ -111,7 +111,7 @@ public function getAllowedDimensionSubspace(): DimensionSpacePointSet foreach ($this->getAllowedCombinations() as $dimensionCombination) { $coordinates = []; foreach ($dimensionCombination as $contentDimensionId => $contentDimensionValue) { - $coordinates[$contentDimensionId] = (string)$contentDimensionValue; + $coordinates[$contentDimensionId] = $contentDimensionValue->value; } $point = DimensionSpacePoint::fromArray($coordinates); diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php index 4748847d2ff..5019a9d1cf1 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/ContentSubgraphVariationWeight.php @@ -54,7 +54,7 @@ public function __construct( public function getWeightInDimension( Dimension\ContentDimensionId $dimensionId ): ?Dimension\ContentDimensionValueSpecializationDepth { - return $this->weight[(string)$dimensionId] ?? null; + return $this->weight[$dimensionId->value] ?? null; } public function canBeComparedTo(ContentSubgraphVariationWeight $other): bool diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php index 760bb176549..aecb51fe6f1 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/DimensionSpacePoint.php @@ -90,7 +90,7 @@ final public static function fromUriRepresentation(string $encoded): self final public function vary(Dimension\ContentDimensionId $dimensionId, string $value): self { $variedCoordinates = $this->coordinates; - $variedCoordinates[(string)$dimensionId] = $value; + $variedCoordinates[$dimensionId->value] = $value; return self::instance($variedCoordinates); } diff --git a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php index c777920ea16..7cc294a242a 100644 --- a/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php +++ b/Neos.ContentRepository.Core/Classes/DimensionSpace/InterDimensionalVariationGraph.php @@ -139,7 +139,7 @@ protected function determineWeightNormalizationBase(): int if (is_null($this->weightNormalizationBase)) { $base = 0; foreach ($this->contentDimensionSource->getContentDimensionsOrderedByPriority() as $contentDimension) { - $base = max($base, $contentDimension->getMaximumDepth()->depth + 1); + $base = max($base, $contentDimension->getMaximumDepth()->value + 1); } $this->weightNormalizationBase = $base; @@ -169,7 +169,7 @@ protected function initializeVariations(): void $dimension = $this->contentDimensionSource->getDimension($dimensionId); foreach ($dimension->getSpecializations($contentDimensionValue) as $specializedValue) { $specializedDimensionSpacePoint = $generalization->dimensionSpacePoint - ->vary($dimensionId, (string)$specializedValue); + ->vary($dimensionId, $specializedValue->value); if ( !$this->contentDimensionZookeeper->getAllowedDimensionSubspace() ->contains($specializedDimensionSpacePoint) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php index 307d1b67e52..c9c68b9d2c8 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php @@ -73,7 +73,7 @@ protected function requireContentStreamToExist( ): void { if (!$contentRepository->getContentStreamFinder()->hasContentStream($contentStreamId)) { throw new ContentStreamDoesNotExistYet( - 'Content stream "' . $contentStreamId . '" does not exist yet.', + 'Content stream "' . $contentStreamId->value . '" does not exist yet.', 1521386692 ); } @@ -98,10 +98,10 @@ protected function requireDimensionSpacePointToExist(DimensionSpacePoint $dimens protected function requireNodeType(NodeTypeName $nodeTypeName): NodeType { try { - return $this->getNodeTypeManager()->getNodeType((string)$nodeTypeName); + return $this->getNodeTypeManager()->getNodeType($nodeTypeName->value); } catch (NodeTypeNotFoundException $exception) { throw new NodeTypeNotFound( - 'Node type "' . $nodeTypeName . '" is unknown to the node type manager.', + 'Node type "' . $nodeTypeName->value . '" is unknown to the node type manager.', 1541671070 ); } @@ -121,7 +121,7 @@ protected function requireNodeTypeToNotBeAbstract(NodeType $nodeType): void protected function requireNodeTypeToBeOfTypeRoot(NodeType $nodeType): void { if (!$nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { - throw new NodeTypeIsNotOfTypeRoot('Node type "' . $nodeType . '" is not of type root.', 1541765701); + throw new NodeTypeIsNotOfTypeRoot('Node type "' . $nodeType->name->value . '" is not of type root.', 1541765701); } } @@ -133,7 +133,7 @@ protected function requireNodeTypeToNotBeOfTypeRoot(NodeType $nodeType): void { if ($nodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { throw new NodeTypeIsOfTypeRoot( - 'Node type "' . $nodeType->name . '" is of type root.', + 'Node type "' . $nodeType->name->value . '" is of type root.', 1541765806 ); } @@ -159,7 +159,7 @@ protected function requireTetheredDescendantNodeTypesToNotBeOfTypeRoot(NodeType foreach ($nodeType->getAutoCreatedChildNodes() as $tetheredChildNodeType) { if ($tetheredChildNodeType->isOfType(NodeTypeName::ROOT_NODE_TYPE_NAME)) { throw new NodeTypeIsOfTypeRoot( - 'Node type "' . $nodeType->name . '" for tethered descendant is of type root.', + 'Node type "' . $nodeType->name->value . '" for tethered descendant is of type root.', 1541767062 ); } @@ -169,16 +169,16 @@ protected function requireTetheredDescendantNodeTypesToNotBeOfTypeRoot(NodeType protected function requireNodeTypeToDeclareProperty(NodeTypeName $nodeTypeName, PropertyName $propertyName): void { - $nodeType = $this->getNodeTypeManager()->getNodeType((string) $nodeTypeName); - if (!isset($nodeType->getProperties()[(string)$propertyName])) { + $nodeType = $this->getNodeTypeManager()->getNodeType($nodeTypeName->value); + if (!isset($nodeType->getProperties()[$propertyName->value])) { } } protected function requireNodeTypeToDeclareReference(NodeTypeName $nodeTypeName, ReferenceName $propertyName): void { - $nodeType = $this->getNodeTypeManager()->getNodeType((string)$nodeTypeName); - if (isset($nodeType->getProperties()[(string)$propertyName])) { - $propertyType = $nodeType->getPropertyType((string)$propertyName); + $nodeType = $this->getNodeTypeManager()->getNodeType($nodeTypeName->value); + if (isset($nodeType->getProperties()[$propertyName->value])) { + $propertyType = $nodeType->getPropertyType($propertyName->value); if ($propertyType === 'reference' || $propertyType === 'references') { return; } @@ -191,8 +191,8 @@ protected function requireNodeTypeToAllowNodesOfTypeInReference( ReferenceName $referenceName, NodeTypeName $nodeTypeNameInQuestion ): void { - $nodeType = $this->getNodeTypeManager()->getNodeType((string)$nodeTypeName); - $propertyDeclaration = $nodeType->getProperties()[(string)$referenceName] ?? null; + $nodeType = $this->getNodeTypeManager()->getNodeType($nodeTypeName->value); + $propertyDeclaration = $nodeType->getProperties()[$referenceName->value] ?? null; if (is_null($propertyDeclaration)) { throw ReferenceCannotBeSet::becauseTheNodeTypeDoesNotDeclareIt($referenceName, $nodeTypeName); } @@ -275,8 +275,8 @@ protected function requireNodeTypeConstraintsImposedByParentToBeMet( // !!! IF YOU ADJUST THIS METHOD, also adjust the method below. if (!$parentsNodeType->allowsChildNodeType($nodeType)) { throw new NodeConstraintException( - 'Node type "' . $nodeType . '" is not allowed for child nodes of type ' - . $parentsNodeType->name + 'Node type "' . $nodeType->name->value . '" is not allowed for child nodes of type ' + . $parentsNodeType->name->value ); } if ( @@ -285,10 +285,10 @@ protected function requireNodeTypeConstraintsImposedByParentToBeMet( && !$parentsNodeType->getTypeOfAutoCreatedChildNode($nodeName)?->name->equals($nodeType->name) ) { throw new NodeConstraintException( - 'Node type "' . $nodeType . '" does not match configured "' - . $parentsNodeType->getTypeOfAutoCreatedChildNode($nodeName)?->name - . '" for auto created child nodes for parent type "' . $parentsNodeType - . '" with name "' . $nodeName . '"' + 'Node type "' . $nodeType->name->value . '" does not match configured "' + . $parentsNodeType->getTypeOfAutoCreatedChildNode($nodeName)?->name->value + . '" for auto created child nodes for parent type "' . $parentsNodeType->name->value + . '" with name "' . $nodeName->value . '"' ); } } @@ -328,8 +328,8 @@ protected function requireNodeTypeConstraintsImposedByGrandparentToBeMet( ) ) { throw new NodeConstraintException( - 'Node type "' . $nodeType . '" is not allowed below tethered child nodes "' . $parentNodeName - . '" of nodes of type "' . $grandParentsNodeType->name . '"', + 'Node type "' . $nodeType->name->value . '" is not allowed below tethered child nodes "' . $parentNodeName->value + . '" of nodes of type "' . $grandParentsNodeType->name->value . '"', 1520011791 ); } @@ -343,7 +343,7 @@ protected function areNodeTypeConstraintsImposedByGrandparentValid( if ( $parentNodeName && $grandParentsNodeType->hasAutoCreatedChildNode($parentNodeName) - && !$grandParentsNodeType->allowsGrandchildNodeType((string)$parentNodeName, $nodeType) + && !$grandParentsNodeType->allowsGrandchildNodeType($parentNodeName->value, $nodeType) ) { return false; } @@ -366,7 +366,7 @@ protected function requireProjectedNodeAggregate( if (!$nodeAggregate) { throw new NodeAggregateCurrentlyDoesNotExist( - 'Node aggregate "' . $nodeAggregateId . '" does currently not exist.', + 'Node aggregate "' . $nodeAggregateId->value . '" does currently not exist.', 1541678486 ); } @@ -390,7 +390,7 @@ protected function requireProjectedNodeAggregateToNotExist( if ($nodeAggregate) { throw new NodeAggregateCurrentlyExists( - 'Node aggregate "' . $nodeAggregateId . '" does currently exist, but should not.', + 'Node aggregate "' . $nodeAggregateId->value . '" does currently exist, but should not.', 1541687645 ); } @@ -414,9 +414,9 @@ public function requireProjectedParentNodeAggregate( if (!$parentNodeAggregate) { throw new NodeAggregateCurrentlyDoesNotExist( - 'Parent node aggregate for ' . $childNodeAggregateId + 'Parent node aggregate for ' . $childNodeAggregateId->value . ' does currently not exist in origin dimension space point ' . $childOriginDimensionSpacePoint - . ' and content stream ' . $contentStreamId, + . ' and content stream ' . $contentStreamId->value, 1645368685 ); } @@ -433,7 +433,7 @@ protected function requireNodeAggregateToCoverDimensionSpacePoint( ): void { if (!$nodeAggregate->coversDimensionSpacePoint($dimensionSpacePoint)) { throw new NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" does currently not cover dimension space point ' . json_encode($dimensionSpacePoint) . '.', 1541678877 @@ -464,7 +464,7 @@ protected function requireNodeAggregateToNotBeRoot(NodeAggregate $nodeAggregate, { if ($nodeAggregate->classification->isRoot()) { throw new NodeAggregateIsRoot( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId . '" is classified as root ' . $extraReason, + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" is classified as root ' . $extraReason, 1554586860 ); } @@ -477,7 +477,7 @@ protected function requireNodeAggregateToBeUntethered(NodeAggregate $nodeAggrega { if ($nodeAggregate->classification->isTethered()) { throw new NodeAggregateIsTethered( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId . '" is classified as tethered.', + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" is classified as tethered.', 1554587288 ); } @@ -494,8 +494,8 @@ protected function requireNodeAggregateToNotBeDescendant( ): void { if ($nodeAggregate->nodeAggregateId->equals($referenceNodeAggregate->nodeAggregateId)) { throw new NodeAggregateIsDescendant( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId - . '" is descendant of node aggregate "' . $referenceNodeAggregate->nodeAggregateId . '"', + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value + . '" is descendant of node aggregate "' . $referenceNodeAggregate->nodeAggregateId->value . '"', 1554971124 ); } @@ -538,8 +538,8 @@ protected function requireNodeNameToBeUnoccupied( ); if (count($dimensionSpacePointsOccupiedByChildNodeName) > 0) { throw new NodeNameIsAlreadyOccupied( - 'Child node name "' . $nodeName . '" is already occupied for parent "' - . $parentNodeAggregateId . '" in dimension space points ' + 'Child node name "' . $nodeName->value . '" is already occupied for parent "' + . $parentNodeAggregateId->value . '" in dimension space points ' . $dimensionSpacePointsOccupiedByChildNodeName ); } @@ -569,9 +569,9 @@ protected function requireNodeNameToBeUncovered( ->getIntersection($dimensionSpacePointsToBeCovered); if (!$alreadyCoveredDimensionSpacePoints->isEmpty()) { throw new NodeNameIsAlreadyCovered( - 'Node name "' . $nodeName . '" is already covered in dimension space points ' + 'Node name "' . $nodeName->value . '" is already covered in dimension space points ' . $alreadyCoveredDimensionSpacePoints . ' by node aggregate "' - . $childNodeAggregate->nodeAggregateId . '".' + . $childNodeAggregate->nodeAggregateId->value . '".' ); } } @@ -587,7 +587,7 @@ protected function requireNodeAggregateToOccupyDimensionSpacePoint( if (!$nodeAggregate->occupiesDimensionSpacePoint($originDimensionSpacePoint)) { throw new DimensionSpacePointIsNotYetOccupied( 'Dimension space point ' . json_encode($originDimensionSpacePoint) - . ' is not yet occupied by node aggregate "' . $nodeAggregate->nodeAggregateId . '"', + . ' is not yet occupied by node aggregate "' . $nodeAggregate->nodeAggregateId->value . '"', 1552595396 ); } @@ -603,7 +603,7 @@ protected function requireNodeAggregateToNotOccupyDimensionSpacePoint( if ($nodeAggregate->occupiesDimensionSpacePoint($originDimensionSpacePoint)) { throw new DimensionSpacePointIsAlreadyOccupied( 'Dimension space point ' . json_encode($originDimensionSpacePoint) - . ' is already occupied by node aggregate "' . $nodeAggregate->nodeAggregateId . '"', + . ' is already occupied by node aggregate "' . $nodeAggregate->nodeAggregateId->value . '"', 1552595441 ); } @@ -618,7 +618,7 @@ protected function requireNodeAggregateToDisableDimensionSpacePoint( ): void { if (!$nodeAggregate->disablesDimensionSpacePoint($dimensionSpacePoint)) { throw new NodeAggregateCurrentlyDoesNotDisableDimensionSpacePoint( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" currently does not disable dimension space point ' . json_encode($dimensionSpacePoint) . '.', 1557735431 @@ -635,7 +635,7 @@ protected function requireNodeAggregateToNotDisableDimensionSpacePoint( ): void { if ($nodeAggregate->disablesDimensionSpacePoint($dimensionSpacePoint)) { throw new NodeAggregateCurrentlyDisablesDimensionSpacePoint( - 'Node aggregate "' . $nodeAggregate->nodeAggregateId + 'Node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" currently disables dimension space point ' . json_encode($dimensionSpacePoint) . '.', 1555179563 ); @@ -647,10 +647,10 @@ protected function validateReferenceProperties( PropertyValuesToWrite $referenceProperties, NodeTypeName $nodeTypeName ): void { - $nodeType = $this->nodeTypeManager->getNodeType((string)$nodeTypeName); + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName->value); foreach ($referenceProperties->values as $propertyName => $propertyValue) { - $referencePropertyConfig = $nodeType->getProperties()[(string)$referenceName]['properties'][$propertyName] + $referencePropertyConfig = $nodeType->getProperties()[$referenceName->value]['properties'][$propertyName] ?? null; if (is_null($referencePropertyConfig)) { diff --git a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php index ccd3e081095..ecea56a49dc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/ContentStreamCommandHandler.php @@ -135,7 +135,7 @@ protected function requireContentStreamToNotExistYet( ): void { if ($contentRepository->getContentStreamFinder()->hasContentStream($contentStreamId)) { throw new ContentStreamAlreadyExists( - 'Content stream "' . $contentStreamId . '" already exists.', + 'Content stream "' . $contentStreamId->value . '" already exists.', 1521386345 ); } @@ -151,7 +151,7 @@ protected function requireContentStreamToExist( ): void { if (!$contentRepository->getContentStreamFinder()->hasContentStream($contentStreamId)) { throw new ContentStreamDoesNotExistYet( - 'Content stream "' . $contentStreamId . '" does not exist yet.', + 'Content stream "' . $contentStreamId->value . '" does not exist yet.', 1521386692 ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php index f40b3436088..2896af0cd29 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php @@ -202,22 +202,22 @@ protected function checkConstraintsImposedByAncestors( ) as $parentAggregate ) { /* @var $parentAggregate NodeAggregate */ - $parentsNodeType = $this->nodeTypeManager->getNodeType((string)$parentAggregate->nodeTypeName); + $parentsNodeType = $this->nodeTypeManager->getNodeType($parentAggregate->nodeTypeName->value); if (!$parentsNodeType->allowsChildNodeType($newNodeType)) { throw new NodeConstraintException( - 'Node type ' . $command->newNodeTypeName - . ' is not allowed below nodes of type ' . $parentAggregate->nodeTypeName + 'Node type ' . $command->newNodeTypeName->value + . ' is not allowed below nodes of type ' . $parentAggregate->nodeTypeName->value ); } if ( $nodeAggregate->nodeName && $parentsNodeType->hasAutoCreatedChildNode($nodeAggregate->nodeName) && $parentsNodeType->getTypeOfAutoCreatedChildNode($nodeAggregate->nodeName)?->name - !== (string)$command->newNodeTypeName + !== $command->newNodeTypeName->value ) { throw new NodeConstraintException( - 'Cannot change type of auto created child node' . $nodeAggregate->nodeName - . ' to ' . $command->newNodeTypeName + 'Cannot change type of auto created child node' . $nodeAggregate->nodeName->value + . ' to ' . $command->newNodeTypeName->value ); } foreach ( @@ -228,20 +228,20 @@ protected function checkConstraintsImposedByAncestors( ) { /* @var $grandParentAggregate NodeAggregate */ $grandParentsNodeType = $this->nodeTypeManager->getNodeType( - (string)$grandParentAggregate->nodeTypeName + $grandParentAggregate->nodeTypeName->value ); if ( $parentAggregate->nodeName && $grandParentsNodeType->hasAutoCreatedChildNode($parentAggregate->nodeName) && !$grandParentsNodeType->allowsGrandchildNodeType( - (string) $parentAggregate->nodeName, + $parentAggregate->nodeName->value, $newNodeType ) ) { throw new NodeConstraintException( - 'Node type "' . $command->newNodeTypeName - . '" is not allowed below auto created child nodes "' . $parentAggregate->nodeName - . '" of nodes of type "' . $grandParentAggregate->nodeTypeName . '"', + 'Node type "' . $command->newNodeTypeName->value + . '" is not allowed below auto created child nodes "' . $parentAggregate->nodeName->value + . '" of nodes of type "' . $grandParentAggregate->nodeTypeName->value . '"', 1520011791 ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Dto/NodeAggregateIdsByNodePaths.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Dto/NodeAggregateIdsByNodePaths.php index 8d22b442aad..b735e38114e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Dto/NodeAggregateIdsByNodePaths.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Dto/NodeAggregateIdsByNodePaths.php @@ -47,7 +47,7 @@ public function __construct(array $nodeAggregateIds) ); } - $this->nodeAggregateIds[(string)$nodePath] = $nodeAggregateId; + $this->nodeAggregateIds[$nodePath->value] = $nodeAggregateId; } } @@ -100,13 +100,13 @@ public function merge(self $other): self public function getNodeAggregateId(NodePath $nodePath): ?NodeAggregateId { - return $this->nodeAggregateIds[(string)$nodePath] ?? null; + return $this->nodeAggregateIds[$nodePath->value] ?? null; } public function add(NodePath $nodePath, NodeAggregateId $nodeAggregateId): self { $nodeAggregateIds = $this->nodeAggregateIds; - $nodeAggregateIds[(string)$nodePath] = $nodeAggregateId; + $nodeAggregateIds[$nodePath->value] = $nodeAggregateId; return new self($nodeAggregateIds); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php index 7077d2d280b..55ba8198665 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php @@ -92,7 +92,7 @@ private function handleCreateNodeAggregateWithNode( private function deserializeDefaultProperties(NodeTypeName $nodeTypeName): PropertyValuesToWrite { - $nodeType = $this->nodeTypeManager->getNodeType((string) $nodeTypeName); + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName->value); $defaultValues = []; foreach ($nodeType->getDefaultValuesForProperties() as $propertyName => $defaultValue) { $propertyType = PropertyType::fromNodeTypeDeclaration( @@ -121,7 +121,7 @@ private function validateProperties(?PropertyValuesToWrite $propertyValues, Node return; } - $nodeType = $this->nodeTypeManager->getNodeType((string) $nodeTypeName); + $nodeType = $this->nodeTypeManager->getNodeType($nodeTypeName->value); foreach ($propertyValues->values as $propertyName => $propertyValue) { if (!isset($nodeType->getProperties()[$propertyName])) { throw PropertyCannotBeSet::becauseTheNodeTypeDoesNotDeclareIt( @@ -299,7 +299,7 @@ private function handleTetheredChildNodes( $nodeName = NodeName::fromString($rawNodeName); $childNodePath = $nodePath ? $nodePath->appendPathSegment($nodeName) - : NodePath::fromString((string) $nodeName); + : NodePath::fromString($nodeName->value); $childNodeAggregateId = $nodeAggregateIds->getNodeAggregateId($childNodePath) ?? NodeAggregateId::create(); $initialPropertyValues = SerializedPropertyValues::defaultFromNodeType($childNodeType); @@ -370,7 +370,7 @@ protected static function populateNodeAggregateIds( $childName = NodeName::fromString($rawChildName); $childPath = $childPath ? $childPath->appendPathSegment($childName) - : NodePath::fromString((string) $childName); + : NodePath::fromString($childName->value); if (!$nodeAggregateIds->getNodeAggregateId($childPath)) { $nodeAggregateIds = $nodeAggregateIds->add( $childPath, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeAggregateIdMapping.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeAggregateIdMapping.php index 4b057a9bb89..da04bac4ed2 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeAggregateIdMapping.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Dto/NodeAggregateIdMapping.php @@ -49,7 +49,7 @@ public function __construct(array $nodeAggregateIds) ); } - $this->nodeAggregateIds[(string)$oldNodeAggregateId] = $newNodeAggregateId; + $this->nodeAggregateIds[$oldNodeAggregateId->value] = $newNodeAggregateId; } } @@ -62,7 +62,7 @@ public static function generateForNodeSubtreeSnapshot(NodeSubtreeSnapshot $nodeS $nodeSubtreeSnapshot->walk( function (NodeSubtreeSnapshot $nodeSubtreeSnapshot) use (&$nodeAggregateIdMapping) { // here, we create new random NodeAggregateIds. - $nodeAggregateIdMapping[(string)$nodeSubtreeSnapshot->nodeAggregateId] = NodeAggregateId::create(); + $nodeAggregateIdMapping[$nodeSubtreeSnapshot->nodeAggregateId->value] = NodeAggregateId::create(); } ); @@ -85,7 +85,7 @@ public static function fromArray(array $array): self public function getNewNodeAggregateId( NodeAggregateId $oldNodeAggregateId ): ?NodeAggregateId { - return $this->nodeAggregateIds[(string)$oldNodeAggregateId] ?? null; + return $this->nodeAggregateIds[$oldNodeAggregateId->value] ?? null; } /** diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php index 8a67053ddc2..9cd8f6e3b06 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php @@ -206,7 +206,7 @@ private function resolveNewParentAssignments( $parentNode = $contentSubgraph->findNodeById($parentId); if ($parentNode === null) { throw new \InvalidArgumentException( - 'Parent ' . $parentId . ' not found in subgraph ' . json_encode($contentSubgraph), + 'Parent ' . $parentId->value . ' not found in subgraph ' . json_encode($contentSubgraph), 1667596931 ); } @@ -247,7 +247,7 @@ private function findSibling( $parent = $contentSubgraph->findParentNode($siblingId); if (is_null($parent)) { throw new \InvalidArgumentException( - 'Parent ' . $parentId . ' not found in subgraph ' . json_encode($contentSubgraph), + 'Parent ' . $parentId->value . ' not found in subgraph ' . json_encode($contentSubgraph), 1645366837 ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php index 81fde66860f..0f264e3a470 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php @@ -138,7 +138,7 @@ private function handleSetSerializedNodeReferences( } $sourceNodeType = $this->requireNodeType($sourceNodeAggregate->nodeTypeName); - $scopeDeclaration = $sourceNodeType->getProperties()[(string)$command->referenceName]['scope'] ?? ''; + $scopeDeclaration = $sourceNodeType->getProperties()[$command->referenceName->value]['scope'] ?? ''; $scope = PropertyScope::tryFrom($scopeDeclaration) ?: PropertyScope::SCOPE_NODE; $affectedOrigins = $scope->resolveAffectedOrigins( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php index 3b8e45a4427..9ea43b119cc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php @@ -103,7 +103,7 @@ protected function requireNodeAggregateNotToBeTethered(NodeAggregate $nodeAggreg { if ($nodeAggregate->classification->isTethered()) { throw new TetheredNodeAggregateCannotBeRemoved( - 'The node aggregate "' . $nodeAggregate->nodeAggregateId + 'The node aggregate "' . $nodeAggregate->nodeAggregateId->value . '" is tethered, and thus cannot be removed.', 1597753832 ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index f61f4a762e7..9ec66b9791b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -207,7 +207,7 @@ private function handleChangeNodeAggregateType( ); if ($tetheredNode === null) { $tetheredNodeAggregateId = $command->tetheredDescendantNodeAggregateIds - ?->getNodeAggregateId(NodePath::fromString((string)$tetheredNodeName)) + ?->getNodeAggregateId(NodePath::fromString($tetheredNodeName->value)) ?: NodeAggregateId::create(); array_push($events, ...iterator_to_array($this->createEventsForMissingTetheredNode( $nodeAggregate, @@ -382,7 +382,7 @@ private function deleteObsoleteTetheredNodesWhenChangingNodeType( foreach ($tetheredNodeAggregates as $tetheredNodeAggregate) { /* @var $tetheredNodeAggregate NodeAggregate */ - if (!isset($expectedTetheredNodes[(string)$tetheredNodeAggregate->nodeName])) { + if (!isset($expectedTetheredNodes[$tetheredNodeAggregate->nodeName->value])) { // this aggregate (or parts thereof) are DISALLOWED according to constraints. // We now need to find out which edges we need to remove, $dimensionSpacePointsToBeRemoved = $this->findDimensionSpacePointsConnectingParentAndChildAggregate( diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index 73c69c415f5..2c7ebde9f0e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -143,7 +143,7 @@ private function handleCreateWorkspace( ); return new EventsToPublish( - StreamName::fromString('Workspace:' . $command->workspaceName), + StreamName::fromString('Workspace:' . $command->workspaceName->value), $events, ExpectedVersion::ANY() ); @@ -184,7 +184,7 @@ private function handleCreateRootWorkspace( ); return new EventsToPublish( - StreamName::fromString('Workspace:' . $command->workspaceName), + StreamName::fromString('Workspace:' . $command->workspaceName->value), $events, ExpectedVersion::ANY() ); @@ -220,7 +220,7 @@ private function handlePublishWorkspace( ) )->block(); - $streamName = StreamName::fromString('Workspace:' . $command->workspaceName); + $streamName = StreamName::fromString('Workspace:' . $command->workspaceName->value); $events = Events::with( new WorkspaceWasPublished( $command->workspaceName, @@ -271,7 +271,7 @@ private function publishContentStream( if ($event instanceof ContentStreamWasForked) { if ($contentStreamWasForkedEvent !== null) { throw new \RuntimeException( - 'Invariant violation: The content stream "' . $contentStreamId + 'Invariant violation: The content stream "' . $contentStreamId->value . '" has two forked events.', 1658740373 ); @@ -290,7 +290,7 @@ private function publishContentStream( } if ($contentStreamWasForkedEvent === null) { - throw new \RuntimeException('Invariant violation: The content stream "' . $contentStreamId + throw new \RuntimeException('Invariant violation: The content stream "' . $contentStreamId->value . '" has NO forked event.', 1658740407); } @@ -384,7 +384,7 @@ private function handleRebaseWorkspace( } } - $streamName = StreamName::fromString('Workspace:' . $command->workspaceName); + $streamName = StreamName::fromString('Workspace:' . $command->workspaceName->value); // if we got so far without an Exception, we can switch the Workspace's active Content stream. if (!$rebaseStatistics->hasErrors()) { @@ -544,7 +544,7 @@ private function handlePublishIndividualNodesFromWorkspace( // 6) switch content stream to forked WS. // if we got so far without an Exception, we can switch the Workspace's active Content stream. - $streamName = StreamName::fromString('Workspace:' . $command->workspaceName); + $streamName = StreamName::fromString('Workspace:' . $command->workspaceName->value); $events = Events::with( new WorkspaceWasPartiallyPublished( $command->workspaceName, @@ -626,7 +626,7 @@ private function handleDiscardIndividualNodesFromWorkspace( // 3) switch content stream to forked WS. // if we got so far without an Exception, we can switch the Workspace's active Content stream. - $streamName = StreamName::fromString('Workspace:' . $command->workspaceName); + $streamName = StreamName::fromString('Workspace:' . $command->workspaceName->value); $events = Events::with( new WorkspaceWasPartiallyDiscarded( $command->workspaceName, @@ -679,7 +679,7 @@ private function handleDiscardWorkspace( )->block(); // if we got so far without an Exception, we can switch the Workspace's active Content stream. - $streamName = StreamName::fromString('Workspace:' . $command->workspaceName); + $streamName = StreamName::fromString('Workspace:' . $command->workspaceName->value); $events = Events::with( new WorkspaceWasDiscarded( $command->workspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Infrastructure/Property/PropertyConverter.php b/Neos.ContentRepository.Core/Classes/Infrastructure/Property/PropertyConverter.php index ada7ea6997c..12fb9e14402 100644 --- a/Neos.ContentRepository.Core/Classes/Infrastructure/Property/PropertyConverter.php +++ b/Neos.ContentRepository.Core/Classes/Infrastructure/Property/PropertyConverter.php @@ -85,12 +85,12 @@ private function serializePropertyValue( return new SerializedPropertyValue( $propertyValue, - (string)$propertyType + $propertyType->value ); } else { // $propertyValue == null and defined in node types (we have a resolved type) // -> we want to set the $propertyName to NULL - return new SerializedPropertyValue(null, (string)$propertyType); + return new SerializedPropertyValue(null, $propertyType->value); } } @@ -104,7 +104,7 @@ public function serializeReferencePropertyValues( foreach ($propertyValuesToWrite->values as $propertyName => $propertyValue) { // reference properties are always completely overwritten, // so we don't need the node properties' unset option - $declaredType = $nodeType->getProperties()[(string)$referenceName]['properties'][$propertyName]['type']; + $declaredType = $nodeType->getProperties()[$referenceName->value]['properties'][$propertyName]['type']; $serializedPropertyValues[$propertyName] = $this->serializePropertyValue( $declaredType, diff --git a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php index eb894102a8b..aa9bada35cc 100644 --- a/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php +++ b/Neos.ContentRepository.Core/Classes/NodeType/NodeType.php @@ -507,7 +507,7 @@ public function getAutoCreatedChildNodes(): array public function hasAutoCreatedChildNode(NodeName $nodeName): bool { $this->initialize(); - return isset($this->fullConfiguration['childNodes'][(string)$nodeName]); + return isset($this->fullConfiguration['childNodes'][$nodeName->value]); } /** @@ -515,8 +515,8 @@ public function hasAutoCreatedChildNode(NodeName $nodeName): bool */ public function getTypeOfAutoCreatedChildNode(NodeName $nodeName): ?NodeType { - return isset($this->fullConfiguration['childNodes'][(string)$nodeName]['type']) - ? $this->nodeTypeManager->getNodeType($this->fullConfiguration['childNodes'][(string)$nodeName]['type']) + return isset($this->fullConfiguration['childNodes'][$nodeName->value]['type']) + ? $this->nodeTypeManager->getNodeType($this->fullConfiguration['childNodes'][$nodeName->value]['type']) : null; } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/AllChildNodesByNodeIdCache.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/AllChildNodesByNodeIdCache.php index 2caf7772cb5..ea8caed28a4 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/AllChildNodesByNodeIdCache.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/AllChildNodesByNodeIdCache.php @@ -42,7 +42,7 @@ public function add( return; } - $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? (string)$nodeTypeConstraints : '*'; + $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? $nodeTypeConstraints->toFilterString() : '*'; $this->childNodes[$parentNodeAggregateId->value][$nodeTypeConstraintsKey] = $childNodes; } @@ -54,7 +54,7 @@ public function contains( return false; } - $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? (string)$nodeTypeConstraints : '*'; + $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? $nodeTypeConstraints->toFilterString() : '*'; return isset($this->childNodes[$parentNodeAggregateId->value][$nodeTypeConstraintsKey]); } @@ -65,7 +65,7 @@ public function findChildNodes( if ($this->isEnabled === false) { return Nodes::createEmpty(); } - $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? (string)$nodeTypeConstraints : '*'; + $nodeTypeConstraintsKey = $nodeTypeConstraints !== null ? $nodeTypeConstraints->toFilterString() : '*'; return $this->childNodes[$parentNodeAggregateId->value][$nodeTypeConstraintsKey] ?? Nodes::createEmpty(); } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NamedChildNodeByNodeIdCache.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NamedChildNodeByNodeIdCache.php index 49c5d6ca4cd..9c2c7bbf933 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NamedChildNodeByNodeIdCache.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NamedChildNodeByNodeIdCache.php @@ -53,7 +53,7 @@ public function add( return; } - $this->nodes[(string)$parentNodeAggregateId][(string)$nodeName] = $node; + $this->nodes[$parentNodeAggregateId->value][$nodeName->value] = $node; } public function contains(NodeAggregateId $parentNodeAggregateId, NodeName $nodeName): bool @@ -62,7 +62,7 @@ public function contains(NodeAggregateId $parentNodeAggregateId, NodeName $nodeN return false; } - return isset($this->nodes[(string)$parentNodeAggregateId][(string)$nodeName]); + return isset($this->nodes[$parentNodeAggregateId->value][$nodeName->value]); } public function get(NodeAggregateId $parentNodeAggregateId, NodeName $nodeName): ?Node @@ -71,6 +71,6 @@ public function get(NodeAggregateId $parentNodeAggregateId, NodeName $nodeName): return null; } - return $this->nodes[(string)$parentNodeAggregateId][(string)$nodeName] ?? null; + return $this->nodes[$parentNodeAggregateId->value][$nodeName->value] ?? null; } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NodeByNodeAggregateIdCache.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NodeByNodeAggregateIdCache.php index 97d83ce5609..ea637e0b26d 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NodeByNodeAggregateIdCache.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/NodeByNodeAggregateIdCache.php @@ -52,7 +52,7 @@ public function knowsAbout(NodeAggregateId $nodeAggregateId): bool return false; } - $key = (string)$nodeAggregateId; + $key = $nodeAggregateId->value; return isset($this->nodes[$key]) || isset($this->nonExistingNodeAggregateIds[$key]); } @@ -62,7 +62,7 @@ public function add(NodeAggregateId $nodeAggregateId, Node $node): void return; } - $key = (string)$nodeAggregateId; + $key = $nodeAggregateId->value; $this->nodes[$key] = $node; } @@ -72,7 +72,7 @@ public function rememberNonExistingNodeAggregateId(NodeAggregateId $nodeAggregat return; } - $key = (string)$nodeAggregateId; + $key = $nodeAggregateId->value; $this->nonExistingNodeAggregateIds[$key] = true; } @@ -82,7 +82,7 @@ public function get(NodeAggregateId $nodeAggregateId): ?Node return null; } - $key = (string)$nodeAggregateId; + $key = $nodeAggregateId->value; return $this->nodes[$key] ?? null; } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/ParentNodeIdByChildNodeIdCache.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/ParentNodeIdByChildNodeIdCache.php index 63d291fefd2..18995fb18ce 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/ParentNodeIdByChildNodeIdCache.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphWithRuntimeCaches/InMemoryCache/ParentNodeIdByChildNodeIdCache.php @@ -48,7 +48,7 @@ public function add(NodeAggregateId $childNodeAggregateId, NodeAggregateId $pare return; } - $key = (string)$childNodeAggregateId; + $key = $childNodeAggregateId->value; $this->parentNodeAggregateIds[$key] = $parentNodeAggregateId; } @@ -58,7 +58,7 @@ public function knowsAbout(NodeAggregateId $childNodeAggregateId): bool return false; } - $key = (string)$childNodeAggregateId; + $key = $childNodeAggregateId->value; return isset($this->parentNodeAggregateIds[$key]) || isset($this->nodesWithoutParentNode[$key]); } @@ -68,7 +68,7 @@ public function rememberNonExistingParentNode(NodeAggregateId $nodeAggregateId): return; } - $key = (string)$nodeAggregateId; + $key = $nodeAggregateId->value; $this->nodesWithoutParentNode[$key] = true; } @@ -79,7 +79,7 @@ public function get(NodeAggregateId $childNodeAggregateId): ?NodeAggregateId return null; } - $key = (string)$childNodeAggregateId; + $key = $childNodeAggregateId->value; return $this->parentNodeAggregateIds[$key] ?? null; } } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodePath.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodePath.php index ceca3a70324..b01e47523ea 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodePath.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodePath.php @@ -73,7 +73,7 @@ public function isAbsolute(): bool */ public function appendPathSegment(NodeName $nodeName): self { - return new self($this->value . '/' . $nodeName); + return new self($this->value . '/' . $nodeName->value); } /** diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php index a5ed59f7994..8709e95a734 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraints.php @@ -116,11 +116,11 @@ public function toFilterString(): string { $parts = []; foreach ($this->explicitlyDisallowedNodeTypeNames as $nodeTypeName) { - $parts[] = '!' . $nodeTypeName; + $parts[] = '!' . $nodeTypeName->value; } foreach ($this->explicitlyAllowedNodeTypeNames as $nodeTypeName) { - $parts[] = (string)$nodeTypeName; + $parts[] = $nodeTypeName->value; } return implode(',', $parts); diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php index a8c41c09585..ec6300d2f31 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeTypeConstraintsWithSubNodeTypes.php @@ -146,11 +146,11 @@ public function toFilterString(): string } foreach ($this->explicitlyDisallowedNodeTypeNames as $nodeTypeName) { - $parts[] = '!' . $nodeTypeName; + $parts[] = '!' . $nodeTypeName->value; } foreach ($this->explicitlyAllowedNodeTypeNames as $nodeTypeName) { - $parts[] = (string)$nodeTypeName; + $parts[] = $nodeTypeName->value; } return implode(',', $parts); diff --git a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateFinder.php b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateFinder.php index fc3cfa34b5c..2164cd7aa1e 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateFinder.php +++ b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateFinder.php @@ -47,9 +47,9 @@ public function findHiddenState( AND nodeaggregateid = :nodeAggregateId ', [ - 'contentStreamId' => (string)$contentStreamId, + 'contentStreamId' => $contentStreamId->value, 'dimensionSpacePointHash' => $dimensionSpacePoint->hash, - 'nodeAggregateId' => (string)$nodeAggregateId, + 'nodeAggregateId' => $nodeAggregateId->value, ] )->fetch(); diff --git a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php index f56de3ef13c..01834b42667 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php @@ -190,8 +190,8 @@ private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): vo AND dimensionspacepointhash IN (:dimensionSpacePointHashes) ', [ - 'contentStreamId' => (string)$event->contentStreamId, - 'nodeAggregateId' => (string)$event->nodeAggregateId, + 'contentStreamId' => $event->contentStreamId->value, + 'nodeAggregateId' => $event->nodeAggregateId->value, 'dimensionSpacePointHashes' => $event->affectedDimensionSpacePoints->getPointHashes() ], [ @@ -212,7 +212,7 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void hidden ) SELECT - "' . (string)$event->newContentStreamId . '" AS contentstreamid, + "' . $event->newContentStreamId->value . '" AS contentstreamid, nodeaggregateid, dimensionspacepoint, dimensionspacepointhash, @@ -221,7 +221,7 @@ private function whenContentStreamWasForked(ContentStreamWasForked $event): void ' . $this->tableName . ' h WHERE h.contentstreamid = :sourceContentStreamId ', [ - 'sourceContentStreamId' => (string)$event->sourceContentStreamId + 'sourceContentStreamId' => $event->sourceContentStreamId->value ]); }); } @@ -243,7 +243,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev 'originalDimensionSpacePointHash' => $event->source->hash, 'newDimensionSpacePointHash' => $event->target->hash, 'newDimensionSpacePoint' => json_encode($event->target->jsonSerialize()), - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ] ); }); diff --git a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateRecord.php b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateRecord.php index dbd798e0a3c..f86bf6d53f4 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateRecord.php +++ b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateRecord.php @@ -72,8 +72,8 @@ public function addToDatabase(Connection $databaseConnection, string $tableName) ); } $databaseConnection->insert($tableName, [ - 'contentStreamId' => (string)$this->contentStreamId, - 'nodeAggregateId' => (string)$this->nodeAggregateId, + 'contentStreamId' => $this->contentStreamId->value, + 'nodeAggregateId' => $this->nodeAggregateId->value, 'dimensionSpacePoint' => json_encode($this->dimensionSpacePoint), 'dimensionSpacePointHash' => $this->dimensionSpacePoint->hash, 'hidden' => (int)$this->hidden, diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php index 806b50118a7..b9b642631a2 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceFinder.php @@ -50,7 +50,7 @@ public function findOneByName(WorkspaceName $name): ?Workspace WHERE workspaceName = :workspaceName ', [ - ':workspaceName' => (string)$name + ':workspaceName' => $name->value ] )->fetchAssociative(); @@ -78,7 +78,7 @@ public function findOneByCurrentContentStreamId( WHERE currentContentStreamId = :currentContentStreamId ', [ - ':currentContentStreamId' => (string)$contentStreamId + ':currentContentStreamId' => $contentStreamId->value ] )->fetchAssociative(); @@ -105,13 +105,13 @@ public function findByPrefix(WorkspaceName $prefix): array WHERE workspaceName LIKE :workspaceNameLike ', [ - ':workspaceNameLike' => $prefix . '%' + ':workspaceNameLike' => $prefix->value . '%' ] )->fetchAllAssociative(); foreach ($workspaceRows as $workspaceRow) { $similarlyNamedWorkspace = $this->createWorkspaceFromDatabaseRow($workspaceRow); - $result[(string)$similarlyNamedWorkspace->workspaceName] = $similarlyNamedWorkspace; + $result[$similarlyNamedWorkspace->workspaceName->value] = $similarlyNamedWorkspace; } return $result; @@ -132,13 +132,13 @@ public function findByBaseWorkspace(WorkspaceName $baseWorkspace): array WHERE baseWorkspaceName = :workspaceName ', [ - ':workspaceName' => (string)$baseWorkspace + ':workspaceName' => $baseWorkspace->value ] )->fetchAllAssociative(); foreach ($workspaceRows as $workspaceRow) { $similarlyNamedWorkspace = $this->createWorkspaceFromDatabaseRow($workspaceRow); - $result[(string)$similarlyNamedWorkspace->workspaceName] = $similarlyNamedWorkspace; + $result[$similarlyNamedWorkspace->workspaceName->value] = $similarlyNamedWorkspace; } return $result; @@ -177,7 +177,7 @@ public function findAll(): Workspaces foreach ($workspaceRows as $workspaceRow) { $similarlyNamedWorkspace = $this->createWorkspaceFromDatabaseRow($workspaceRow); - $result[(string)$similarlyNamedWorkspace->workspaceName] = $similarlyNamedWorkspace; + $result[$similarlyNamedWorkspace->workspaceName->value] = $similarlyNamedWorkspace; } return Workspaces::fromArray($result); @@ -204,7 +204,7 @@ public function findOutdated(): array foreach ($workspaceRows as $workspaceRow) { $similarlyNamedWorkspace = $this->createWorkspaceFromDatabaseRow($workspaceRow); - $result[(string)$similarlyNamedWorkspace->workspaceName] = $similarlyNamedWorkspace; + $result[$similarlyNamedWorkspace->workspaceName->value] = $similarlyNamedWorkspace; } return $result; diff --git a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceRuntimeCache.php b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceRuntimeCache.php index 42b3bf62069..5db459a2fff 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceRuntimeCache.php +++ b/Neos.ContentRepository.Core/Classes/Projection/Workspace/WorkspaceRuntimeCache.php @@ -48,8 +48,8 @@ public function disableCache(): void public function getWorkspaceByName(WorkspaceName $name): ?Workspace { - if ($this->cacheEnabled === true && isset($this->cachedWorkspacesByName[(string)$name])) { - return $this->cachedWorkspacesByName[(string)$name]; + if ($this->cacheEnabled === true && isset($this->cachedWorkspacesByName[$name->value])) { + return $this->cachedWorkspacesByName[$name->value]; } return null; } @@ -68,9 +68,9 @@ public function getByCurrentContentStreamId(ContentStreamId $contentStreamId): ? { if ( $this->cacheEnabled === true - && isset($this->cachedWorkspacesByContentStreamId[(string)$contentStreamId]) + && isset($this->cachedWorkspacesByContentStreamId[$contentStreamId->value]) ) { - return $this->cachedWorkspacesByContentStreamId[(string)$contentStreamId]; + return $this->cachedWorkspacesByContentStreamId[$contentStreamId->value]; } return null; } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php index d2d975d6667..5f3981f1317 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint.php @@ -30,7 +30,7 @@ public static function butWasSupposedTo( DimensionSpacePoint $coveredDimensionSpacePoint ): self { return new self( - 'Node aggregate "' . $nodeAggregateId + 'Node aggregate "' . $nodeAggregateId->value . '" does currently not cover dimension space point ' . $coveredDimensionSpacePoint, 1554902892 ); diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php index 246d8debf68..780da729258 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet.php @@ -31,7 +31,7 @@ public static function butWasSupposedTo( DimensionSpacePointSet $actualDimensionSpacePointSet ): NodeAggregateDoesCurrentlyNotCoverDimensionSpacePointSet { return new self( - 'Node aggregate "' . $nodeAggregateId . '" does not cover expected dimension space point set ' + 'Node aggregate "' . $nodeAggregateId->value . '" does not cover expected dimension space point set ' . $expectedCoveredDimensionSpacePointSet . ' but ' . $actualDimensionSpacePointSet . '.', 1571134743 ); diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php index 1d95ca22fb8..71d917c2204 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeAggregateDoesCurrentlyNotOccupyDimensionSpacePoint.php @@ -30,7 +30,7 @@ public static function butWasSupposedTo( OriginDimensionSpacePoint $occupiedDimensionSpacePoint ): self { return new self( - 'Node aggregate "' . $nodeAggregateId + 'Node aggregate "' . $nodeAggregateId->value . '" does currently not occupy dimension space point ' . $occupiedDimensionSpacePoint, 1554902613 ); diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeTypeIsAbstract.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeTypeIsAbstract.php index 0b50a71ef1f..c230f290eaa 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeTypeIsAbstract.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/NodeTypeIsAbstract.php @@ -23,6 +23,6 @@ final class NodeTypeIsAbstract extends \DomainException { public static function butWasNotSupposedToBe(NodeTypeName $nodeTypeName): self { - return new self('Given node type "' . $nodeTypeName . '" is abstract.', 1630061720); + return new self('Given node type "' . $nodeTypeName->value . '" is abstract.', 1630061720); } } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyCannotBeSet.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyCannotBeSet.php index e833635c8d2..8b2c1937c93 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyCannotBeSet.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyCannotBeSet.php @@ -30,7 +30,7 @@ public static function becauseTheValueDoesNotMatchTheConfiguredType( string $configuredType ): self { return new self( - 'Property "' . $propertyName . '" cannot be set to a value of type "' . $attemptedType + 'Property "' . $propertyName->value . '" cannot be set to a value of type "' . $attemptedType . '", must be of type "' . $configuredType . '".', 1615466573 ); @@ -41,8 +41,8 @@ public static function becauseTheNodeTypeDoesNotDeclareIt( NodeTypeName $nodeTypeName ): self { return new self( - 'Property "' . $propertyName . '" cannot be set because node type "' - . $nodeTypeName . '" does not declare it.', + 'Property "' . $propertyName->value . '" cannot be set because node type "' + . $nodeTypeName->value . '" does not declare it.', 1615664798 ); } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyTypeIsInvalid.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyTypeIsInvalid.php index a520de42c91..8b5c241e063 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyTypeIsInvalid.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/PropertyTypeIsInvalid.php @@ -27,8 +27,8 @@ final class PropertyTypeIsInvalid extends \DomainException public static function becauseItIsReference(PropertyName $propertyName, NodeTypeName $nodeTypeName): self { return new self( - 'Given property "' . $propertyName . '" is declared as "reference" in node type "' - . $nodeTypeName . '" and must be treated as such.', + 'Given property "' . $propertyName->value . '" is declared as "reference" in node type "' + . $nodeTypeName->value . '" and must be treated as such.', 1630063201 ); } @@ -39,8 +39,8 @@ public static function becauseItIsUndefined( NodeTypeName $nodeTypeName ): self { return new self( - 'Given property "' . $propertyName . '" is declared as undefined type "' . $declaredType - . '" in node type "' . $nodeTypeName . '"', + 'Given property "' . $propertyName->value . '" is declared as undefined type "' . $declaredType + . '" in node type "' . $nodeTypeName->value . '"', 1630063406 ); } diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/ReferenceCannotBeSet.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/ReferenceCannotBeSet.php index ab7d61a50d2..47929baa74e 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/ReferenceCannotBeSet.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/ReferenceCannotBeSet.php @@ -30,8 +30,8 @@ public static function becauseTheNodeTypeDoesNotDeclareIt( NodeTypeName $nodeTypeName ): self { return new self( - 'Reference "' . $propertyName . '" cannot be set because node type "' - . $nodeTypeName . '" does not declare it.', + 'Reference "' . $propertyName->value . '" cannot be set because node type "' + . $nodeTypeName->value . '" does not declare it.', 1618670106 ); } @@ -42,8 +42,8 @@ public static function becauseTheConstraintsAreNotMatched( NodeTypeName $nameOfAttemptedType ): self { return new self( - 'Reference "' . $referenceName . '" cannot be set for node type "' - . $nodeTypeName . '" because the constraints do not allow nodes of type "' . $nameOfAttemptedType . '"', + 'Reference "' . $referenceName->value . '" cannot be set for node type "' + . $nodeTypeName->value . '" because the constraints do not allow nodes of type "' . $nameOfAttemptedType->value . '"', 1648502149 ); } @@ -54,8 +54,8 @@ public static function becauseTheItDoesNotDeclareAProperty( PropertyName $propertyName ): self { return new self( - 'Reference "' . $referenceName . '" cannot be set for node type "' - . $nodeTypeName . '" because it does not declare given property "' . $propertyName . '"', + 'Reference "' . $referenceName->value . '" cannot be set for node type "' + . $nodeTypeName->value . '" because it does not declare given property "' . $propertyName->value . '"', 1658406662 ); } @@ -68,8 +68,8 @@ public static function becauseAPropertyDoesNotMatchTheDeclaredType( string $configuredType ): self { return new self( - 'Reference "' . $referenceName . '" cannot be set for node type "' . $nodeTypeName - . '" because its property "' . $propertyName . '" cannot be set to a value of type "' . $attemptedType + 'Reference "' . $referenceName->value . '" cannot be set for node type "' . $nodeTypeName->value + . '" because its property "' . $propertyName->value . '" cannot be set to a value of type "' . $attemptedType . '", must be of type "' . $configuredType . '".', 1658406762 ); diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php index 329264c9a1a..66a8016be69 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Node/NodeAggregateIds.php @@ -60,7 +60,7 @@ public static function fromArray(array $array): self $nodeAggregateIds = []; foreach ($array as $serializedNodeAggregateId) { if ($serializedNodeAggregateId instanceof NodeAggregateId) { - $nodeAggregateIds[(string)$serializedNodeAggregateId] = $serializedNodeAggregateId; + $nodeAggregateIds[$serializedNodeAggregateId->value] = $serializedNodeAggregateId; } else { $nodeAggregateIds[$serializedNodeAggregateId] = NodeAggregateId::fromString($serializedNodeAggregateId); } diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/EventSourcedTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/EventSourcedTrait.php index f6b8ca9e5a2..4f9ed27fdea 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/EventSourcedTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/EventSourcedTrait.php @@ -548,7 +548,7 @@ public function theSubtreeForNodeAggregateWithNodeTypesAndLevelsDeepShouldBe( Assert::assertSame($expectedLevel, $actualLevel, 'Level does not match in index ' . $i . ', expected: ' . $expectedLevel . ', actual: ' . $actualLevel . ' (adapter: ' . $adapterName . ')'); $expectedNodeAggregateId = NodeAggregateId::fromString($expectedRow['nodeAggregateId']); $actualNodeAggregateId = $flattenedSubtree[$i]->node->nodeAggregateId; - Assert::assertTrue($expectedNodeAggregateId->equals($actualNodeAggregateId), 'NodeAggregateId does not match in index ' . $i . ', expected: "' . $expectedNodeAggregateId . '", actual: "' . $actualNodeAggregateId . '" (adapter: ' . $adapterName . ')'); + Assert::assertTrue($expectedNodeAggregateId->equals($actualNodeAggregateId), 'NodeAggregateId does not match in index ' . $i . ', expected: "' . $expectedNodeAggregateId->value . '", actual: "' . $actualNodeAggregateId . '" (adapter: ' . $adapterName . ')'); } } } @@ -596,7 +596,7 @@ public function iGetTheNodeAddressForNodeAggregate(string $rawNodeAggregateId, $ $subgraph = $this->contentGraph->getSubgraph($this->contentStreamId, $this->dimensionSpacePoint, $this->visibilityConstraints); $nodeAggregateId = NodeAggregateId::fromString($rawNodeAggregateId); $node = $subgraph->findNodeById($nodeAggregateId); - Assert::assertNotNull($node, 'Did not find a node with aggregate id "' . $nodeAggregateId . '"'); + Assert::assertNotNull($node, 'Did not find a node with aggregate id "' . $nodeAggregateId->value . '"'); $this->currentNodeAddresses[$alias] = new NodeAddress( $this->contentStreamId, diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/Features/NodeRenaming.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/Features/NodeRenaming.php index 63dcd2e5cf0..440f618b646 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/Features/NodeRenaming.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/Features/NodeRenaming.php @@ -47,7 +47,7 @@ public function iExpectTheNodeToHaveTheName(string $nodeAggregateId, string $nod foreach ($this->getCurrentSubgraphs() as $adapterName => $subgraph) { assert($subgraph instanceof ContentSubgraphInterface); $node = $subgraph->findNodeById(NodeAggregateId::fromString($nodeAggregateId)); - Assert::assertEquals($nodeName, (string)$node->nodeName, 'Node Names do not match in adapter ' . $adapterName); + Assert::assertEquals($nodeName, $node->nodeName->value, 'Node Names do not match in adapter ' . $adapterName); } } } diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/NodeTraversalTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/NodeTraversalTrait.php index 8a54dadcc8c..ed465b0c20e 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/NodeTraversalTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/NodeTraversalTrait.php @@ -327,7 +327,7 @@ public function iExecuteTheRetrieveNodePathQueryIExpectTheFollowingNodes(string if ($expectedExceptionMessage !== null) { Assert::fail('Expected an exception but none was thrown'); } - Assert::assertSame((string)$expectedNodePath, (string)$actualNodePath); + Assert::assertSame($expectedNodePath->value, $actualNodePath->value); } } diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php index ca2084c0998..b7170a1d826 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeAggregateTrait.php @@ -138,9 +138,9 @@ public function iExpectThisNodeAggregateToBeOfType(string $serializedExpectedNod $expectedNodeTypeName = NodeTypeName::fromString($serializedExpectedNodeTypeName); $this->assertOnCurrentNodeAggregates(function (NodeAggregate $nodeAggregate, string $adapterName) use ($expectedNodeTypeName) { Assert::assertSame( - (string)$expectedNodeTypeName, - (string)$nodeAggregate->nodeTypeName, - 'Node types do not match in adapter "' . $adapterName . '". Expected "' . $expectedNodeTypeName . '", got "' . $nodeAggregate->nodeTypeName . '".' + $expectedNodeTypeName->value, + $nodeAggregate->nodeTypeName->value, + 'Node types do not match in adapter "' . $adapterName . '". Expected "' . $expectedNodeTypeName->value . '", got "' . $nodeAggregate->nodeTypeName->value . '".' ); }); } @@ -163,7 +163,7 @@ public function iExpectThisNodeAggregateToHaveTheName(string $serializedExpected { $expectedNodeName = NodeName::fromString($serializedExpectedNodeName); $this->assertOnCurrentNodeAggregates(function (NodeAggregate $nodeAggregate, string $adapterName) use ($expectedNodeName) { - Assert::assertSame((string)$expectedNodeName, (string)$nodeAggregate->nodeName, 'Node names do not match in adapter "' . $adapterName . '", expected "' . $expectedNodeName . '", got "' . $nodeAggregate->nodeName . '".'); + Assert::assertSame($expectedNodeName->value, $nodeAggregate->nodeName->value, 'Node names do not match in adapter "' . $adapterName . '", expected "' . $expectedNodeName->value . '", got "' . $nodeAggregate->nodeName->value . '".'); }); } @@ -192,10 +192,10 @@ public function iExpectThisNodeAggregateToHaveTheParentNodeAggregates(string $se $expectedNodeAggregateIds = NodeAggregateIds::fromJsonString($serializedExpectedNodeAggregateIds); $this->assertOnCurrentNodeAggregates(function (NodeAggregate $nodeAggregate, string $adapterName) use ($expectedNodeAggregateIds) { $expectedDiscriminators = array_values(array_map(function (NodeAggregateId $nodeAggregateId) { - return $this->contentStreamId . ';' . $nodeAggregateId; + return $this->contentStreamId . ';' . $nodeAggregateId->value; }, $expectedNodeAggregateIds->getIterator()->getArrayCopy())); $actualDiscriminators = array_values(array_map(function (NodeAggregate $parentNodeAggregate) { - return $parentNodeAggregate->contentStreamId . ';' . $parentNodeAggregate->nodeAggregateId; + return $parentNodeAggregate->contentStreamId->value . ';' . $parentNodeAggregate->nodeAggregateId->value; }, iterator_to_array( $this->getActiveContentGraphs()[$adapterName]->findParentNodeAggregates( $nodeAggregate->contentStreamId, @@ -235,10 +235,10 @@ public function iExpectThisNodeAggregateToHaveTheChildNodeAggregates(string $ser $expectedNodeAggregateIds = NodeAggregateIds::fromJsonString($serializedExpectedNodeAggregateIds); $this->assertOnCurrentNodeAggregates(function (NodeAggregate $nodeAggregate, string $adapterName) use ($expectedNodeAggregateIds) { $expectedDiscriminators = array_values(array_map(function (NodeAggregateId $nodeAggregateId) { - return $this->contentStreamId . ':' . $nodeAggregateId; + return $this->contentStreamId . ':' . $nodeAggregateId->value; }, $expectedNodeAggregateIds->getIterator()->getArrayCopy())); $actualDiscriminators = array_values(array_map(function (NodeAggregate $parentNodeAggregate) { - return $parentNodeAggregate->contentStreamId . ':' . $parentNodeAggregate->nodeAggregateId; + return $parentNodeAggregate->contentStreamId->value . ':' . $parentNodeAggregate->nodeAggregateId->value; }, iterator_to_array($this->getActiveContentGraphs()[$adapterName]->findChildNodeAggregates( $nodeAggregate->contentStreamId, $nodeAggregate->nodeAggregateId diff --git a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php index 682ac13c115..b51ac21a111 100644 --- a/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php +++ b/Neos.ContentRepository.Core/Tests/Behavior/Features/Bootstrap/ProjectedNodeTrait.php @@ -124,7 +124,7 @@ public function iExpectNodeAggregateIdToLeadToNode( $expectedDiscriminator = NodeDiscriminator::fromShorthand($serializedNodeDiscriminator); $this->initializeCurrentNodesFromContentSubgraphs(function (ContentSubgraphInterface $subgraph, string $adapterName) use ($nodeAggregateId, $expectedDiscriminator) { $currentNode = $subgraph->findNodeById($nodeAggregateId); - Assert::assertNotNull($currentNode, 'No node could be found by node aggregate id "' . $nodeAggregateId . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); + Assert::assertNotNull($currentNode, 'No node could be found by node aggregate id "' . $nodeAggregateId->value . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); $actualDiscriminator = NodeDiscriminator::fromNode($currentNode); Assert::assertTrue($expectedDiscriminator->equals($actualDiscriminator), 'Node discriminators do not match. Expected was ' . json_encode($expectedDiscriminator) . ' , given was ' . json_encode($actualDiscriminator) . ' in adapter "' . $adapterName . '"'); return $currentNode; @@ -143,7 +143,7 @@ public function iExpectNodeAggregateIdToLeadToNoNode(string $serializedNodeAggre $nodeByAggregateId = $subgraph->findNodeById($nodeAggregateId); if (!is_null($nodeByAggregateId)) { Assert::fail( - 'A node was found by node aggregate id "' . $nodeAggregateId + 'A node was found by node aggregate id "' . $nodeAggregateId->value . '" in content subgraph {' . $this->dimensionSpacePoint . ',' . $this->contentStreamId . '} and adapter "' . $adapterName . '"' ); @@ -167,7 +167,7 @@ public function iExpectPathToLeadToNode(string $serializedNodePath, string $seri $expectedDiscriminator = NodeDiscriminator::fromShorthand($serializedNodeDiscriminator); $this->initializeCurrentNodesFromContentSubgraphs(function (ContentSubgraphInterface $subgraph, string $adapterName) use ($nodePath, $expectedDiscriminator) { $currentNode = $subgraph->findNodeByPath($nodePath, $this->getRootNodeAggregateId()); - Assert::assertNotNull($currentNode, 'No node could be found by node path "' . $nodePath . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); + Assert::assertNotNull($currentNode, 'No node could be found by node path "' . $nodePath->value . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); $actualDiscriminator = NodeDiscriminator::fromNode($currentNode); Assert::assertTrue($expectedDiscriminator->equals($actualDiscriminator), 'Node discriminators do not match. Expected was ' . json_encode($expectedDiscriminator) . ' , given was ' . json_encode($actualDiscriminator) . ' in adapter "' . $adapterName . '"'); return $currentNode; @@ -187,7 +187,7 @@ public function iExpectPathToLeadToNoNode(string $serializedNodePath): void $nodePath = NodePath::fromString($serializedNodePath); foreach ($this->getCurrentSubgraphs() as $adapterName => $subgraph) { $nodeByPath = $subgraph->findNodeByPath($nodePath, $this->getRootNodeAggregateId()); - Assert::assertNull($nodeByPath, 'A node was found by node path "' . $nodePath . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); + Assert::assertNull($nodeByPath, 'A node was found by node path "' . $nodePath->value . '" in content subgraph "' . $this->dimensionSpacePoint . '@' . $this->contentStreamId . '" and adapter "' . $adapterName . '"'); } } @@ -259,7 +259,7 @@ public function iExpectThisNodeToBeOfType(string $serializedExpectedNodeTypeName $expectedNodeTypeName = NodeTypeName::fromString($serializedExpectedNodeTypeName); $this->assertOnCurrentNodes(function (Node $currentNode, string $adapterName) use ($expectedNodeTypeName) { $actualNodeTypeName = $currentNode->nodeTypeName; - Assert::assertSame($expectedNodeTypeName, $actualNodeTypeName, 'Actual node type name "' . $actualNodeTypeName .'" does not match expected "' . $expectedNodeTypeName . '" in adapter "' . $adapterName . '"'); + Assert::assertSame($expectedNodeTypeName, $actualNodeTypeName, 'Actual node type name "' . $actualNodeTypeName->value .'" does not match expected "' . $expectedNodeTypeName->value . '" in adapter "' . $adapterName . '"'); }); } @@ -272,7 +272,7 @@ public function iExpectThisNodeToBeNamed(string $serializedExpectedNodeName): vo $expectedNodeName = NodeName::fromString($serializedExpectedNodeName); $this->assertOnCurrentNodes(function (Node $currentNode, string $adapterName) use ($expectedNodeName) { $actualNodeName = $currentNode->nodeName; - Assert::assertSame((string)$expectedNodeName, (string)$actualNodeName, 'Actual node name "' . $actualNodeName .'" does not match expected "' . $expectedNodeName . '" in adapter "' . $adapterName . '"'); + Assert::assertSame($expectedNodeName->value, $actualNodeName->value, 'Actual node name "' . $actualNodeName->value .'" does not match expected "' . $expectedNodeName->value . '" in adapter "' . $adapterName . '"'); }); } @@ -521,7 +521,7 @@ public function iExpectThisNodeToHaveTheFollowingChildNodes(TableNode $expectedC foreach ($expectedChildNodesTable->getHash() as $index => $row) { $expectedNodeName = NodeName::fromString($row['Name']); $actualNodeName = $actualChildNodes[$index]->nodeName; - Assert::assertEquals($expectedNodeName, $actualNodeName, 'ContentSubgraph::findChildNodes: Node name in index ' . $index . ' does not match in adapter "' . $adapterName . '". Expected: "' . $expectedNodeName . '" Actual: "' . $actualNodeName . '"'); + Assert::assertEquals($expectedNodeName, $actualNodeName, 'ContentSubgraph::findChildNodes: Node name in index ' . $index . ' does not match in adapter "' . $adapterName . '". Expected: "' . $expectedNodeName->value . '" Actual: "' . $actualNodeName . '"'); if (isset($row['NodeDiscriminator'])) { $expectedNodeDiscriminator = NodeDiscriminator::fromShorthand($row['NodeDiscriminator']); $actualNodeDiscriminator = NodeDiscriminator::fromNode($actualChildNodes[$index]); diff --git a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/ExampleDimensionSource.php b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/ExampleDimensionSource.php index 932c66a9bbb..7a08fbe1fc6 100644 --- a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/ExampleDimensionSource.php +++ b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/ExampleDimensionSource.php @@ -113,7 +113,7 @@ public function getDimension(Dimension\ContentDimensionId $dimensionId): ?Dimens $this->initializeDimensions(); } - return $this->dimensions[(string)$dimensionId] ?? null; + return $this->dimensions[$dimensionId->value] ?? null; } /** diff --git a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/VariationExampleDimensionSource.php b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/VariationExampleDimensionSource.php index 25cba9c0fa5..a298e93fc39 100644 --- a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/VariationExampleDimensionSource.php +++ b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/Fixtures/VariationExampleDimensionSource.php @@ -74,7 +74,7 @@ public function getDimension(Dimension\ContentDimensionId $dimensionId): ?Dimens $this->initializeDimensions(); } - return $this->dimensions[(string)$dimensionId] ?? null; + return $this->dimensions[$dimensionId->value] ?? null; } /** diff --git a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/InterDimensionalVariationGraphTest.php b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/InterDimensionalVariationGraphTest.php index c74c209080d..f540794e500 100644 --- a/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/InterDimensionalVariationGraphTest.php +++ b/Neos.ContentRepository.Core/Tests/Unit/DimensionSpace/InterDimensionalVariationGraphTest.php @@ -638,7 +638,7 @@ public function testDetermineWeightNormalizationBaseEvaluatesToMaximumDimensionD $dimensionZookeeper ]); - $this->assertSame(max($firstDepth->depth, $secondDepth->depth) + 1, $graph->_call('determineWeightNormalizationBase')); + $this->assertSame(max($firstDepth->value, $secondDepth->value) + 1, $graph->_call('determineWeightNormalizationBase')); } public function testGetVariantTypeCorrectlyDeterminesTheVariantType() diff --git a/Neos.ContentRepository.Export/src/Processors/EventExportProcessor.php b/Neos.ContentRepository.Export/src/Processors/EventExportProcessor.php index cdd3721b5aa..e6dc0642e8f 100644 --- a/Neos.ContentRepository.Export/src/Processors/EventExportProcessor.php +++ b/Neos.ContentRepository.Export/src/Processors/EventExportProcessor.php @@ -39,7 +39,7 @@ public function run(): ProcessorResult return ProcessorResult::error('Failed to find live workspace'); } $streamName = StreamName::fromString( - 'ContentStream:' . $liveWorkspace->currentContentStreamId + 'ContentStream:' . $liveWorkspace->currentContentStreamId->value ); $eventStream = $this->eventStore->load($streamName); diff --git a/Neos.ContentRepository.Export/src/Processors/EventStoreImportProcessor.php b/Neos.ContentRepository.Export/src/Processors/EventStoreImportProcessor.php index db36fd27f9b..bf91ff2c6d6 100644 --- a/Neos.ContentRepository.Export/src/Processors/EventStoreImportProcessor.php +++ b/Neos.ContentRepository.Export/src/Processors/EventStoreImportProcessor.php @@ -65,7 +65,7 @@ public function run(): ProcessorResult $keepStreamName = true; } if (!$keepStreamName) { - $event = $event->processPayload(fn(array $payload) => isset($payload['contentStreamId']) ? [...$payload, 'contentStreamId' => (string)$this->contentStreamId] : $payload); + $event = $event->processPayload(fn(array $payload) => isset($payload['contentStreamId']) ? [...$payload, 'contentStreamId' => $this->contentStreamId->value] : $payload); } if (!$this->keepEventIds) { try { @@ -108,7 +108,7 @@ public function run(): ProcessorResult assert($this->contentStreamId !== null); - $contentStreamStreamName = StreamName::fromString('ContentStream:' . $this->contentStreamId); + $contentStreamStreamName = StreamName::fromString('ContentStream:' . $this->contentStreamId->value); $events = Events::with( $this->normalizeEvent( new ContentStreamWasCreated( diff --git a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php index c6730f1cdf0..3b8ad8dbf71 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Tests/Behavior/Bootstrap/FeatureContext.php @@ -95,7 +95,7 @@ public function iHaveTheFollowingNodeDataRows(TableNode $nodeDataRows): void return [ 'path' => $row['Path'], 'parentpath' => implode('/', array_slice(explode('/', $row['Path']), 0, -1)) ?: '/', - 'identifier' => $row['Identifier'] ?? (string)NodeAggregateId::create(), + 'identifier' => $row['Identifier'] ?? NodeAggregateId::create()->value, 'nodetype' => $row['Node Type'] ?? 'unstructured', 'properties' => !empty($row['Properties']) ? $row['Properties'] : '{}', 'dimensionvalues' => !empty($row['Dimension Values']) ? $row['Dimension Values'] : '{}', diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ChildrenOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ChildrenOperation.php index bb4d88ff1ea..ac2298d196e 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ChildrenOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ChildrenOperation.php @@ -86,9 +86,9 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $childNodes = $this->contentRepositoryRegistry->subgraphForNode($contextNode) ->findChildNodes($contextNode->nodeAggregateId, FindChildNodesFilter::create()); foreach ($childNodes as $childNode) { - if (!isset($outputNodeAggregateIds[(string)$childNode->nodeAggregateId])) { + if (!isset($outputNodeAggregateIds[$childNode->nodeAggregateId->value])) { $output[] = $childNode; - $outputNodeAggregateIds[(string)$childNode->nodeAggregateId] = true; + $outputNodeAggregateIds[$childNode->nodeAggregateId->value] = true; } } } @@ -151,10 +151,10 @@ protected function earlyOptimizationOfFilters(FlowQuery $flowQuery, array $parse } if (!is_null($resolvedNode) && !isset($filteredOutputNodeIdentifiers[ - (string)$resolvedNode->nodeAggregateId + $resolvedNode->nodeAggregateId->value ])) { $filteredOutput[] = $resolvedNode; - $filteredOutputNodeIdentifiers[(string)$resolvedNode->nodeAggregateId] = true; + $filteredOutputNodeIdentifiers[$resolvedNode->nodeAggregateId->value] = true; } } } elseif (count($instanceOfFilters) > 0) { @@ -178,10 +178,10 @@ protected function earlyOptimizationOfFilters(FlowQuery $flowQuery, array $parse foreach ($childNodes as $childNode) { if (!isset($filteredOutputNodeIdentifiers[ - (string)$childNode->nodeAggregateId + $childNode->nodeAggregateId->value ])) { $filteredOutput[] = $childNode; - $filteredOutputNodeIdentifiers[(string)$childNode->nodeAggregateId] = true; + $filteredOutputNodeIdentifiers[$childNode->nodeAggregateId->value] = true; } } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php index 7bda720796d..011b21d9b7e 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FilterOperation.php @@ -104,7 +104,7 @@ protected function matchesPropertyNameFilter($element, $propertyNameFilter) */ protected function matchesIdentifierFilter($element, $identifier) { - return (strtolower((string)$element->nodeAggregateId) === strtolower($identifier)); + return (strtolower($element->nodeAggregateId->value) === strtolower($identifier)); } /** diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php index 6d2e5a87140..df31030ee87 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/FindOperation.php @@ -197,7 +197,7 @@ protected function getEntryPoints(array $contextNodes): array foreach ($contextNodes as $contextNode) { assert($contextNode instanceof Node); $subgraph = $this->contentRepositoryRegistry->subgraphForNode($contextNode); - $subgraphIdentifier = md5($contextNode->subgraphIdentity->contentStreamId + $subgraphIdentifier = md5($contextNode->subgraphIdentity->contentStreamId->value . '@' . $contextNode->subgraphIdentity->dimensionSpacePoint); if (!isset($entryPoints[(string) $subgraphIdentifier])) { $entryPoints[(string) $subgraphIdentifier] = [ diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php index 5013af318a8..d644f2d7a69 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextAllOperation.php @@ -70,8 +70,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $outputNodePaths = []; foreach ($flowQuery->getContext() as $contextNode) { foreach ($this->getNextForNode($contextNode) as $nextNode) { - if ($nextNode !== null && !isset($outputNodePaths[(string)$nextNode->nodeAggregateId])) { - $outputNodePaths[(string)$nextNode->nodeAggregateId] = true; + if ($nextNode !== null && !isset($outputNodePaths[$nextNode->nodeAggregateId->value])) { + $outputNodePaths[$nextNode->nodeAggregateId->value] = true; $output[] = $nextNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php index 27ad6a8ada6..797142689be 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextOperation.php @@ -70,8 +70,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $outputNodePaths = []; foreach ($flowQuery->getContext() as $contextNode) { $nextNode = $this->getNextForNode($contextNode); - if ($nextNode !== null && !isset($outputNodePaths[(string)$nextNode->nodeAggregateId])) { - $outputNodePaths[(string)$nextNode->nodeAggregateId] = true; + if ($nextNode !== null && !isset($outputNodePaths[$nextNode->nodeAggregateId->value])) { + $outputNodePaths[$nextNode->nodeAggregateId->value] = true; $output[] = $nextNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php index bd15cbeb532..5006fdb6222 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/NextUntilOperation.php @@ -88,8 +88,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) foreach ($nextNodes as $nextNode) { if ($nextNode !== null - && !isset($outputNodeIdentifiers[(string)$nextNode->nodeAggregateId])) { - $outputNodeIdentifiers[(string)$nextNode->nodeAggregateId] = true; + && !isset($outputNodeIdentifiers[$nextNode->nodeAggregateId->value])) { + $outputNodeIdentifiers[$nextNode->nodeAggregateId->value] = true; $output[] = $nextNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php index b46f8733cb3..57f1037f6e1 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentOperation.php @@ -74,9 +74,9 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) continue; } - if (!isset($outputNodeAggregateIds[(string)$parentNode->nodeAggregateId])) { + if (!isset($outputNodeAggregateIds[$parentNode->nodeAggregateId->value])) { $output[] = $parentNode; - $outputNodeAggregateIds[(string)$parentNode->nodeAggregateId] = true; + $outputNodeAggregateIds[$parentNode->nodeAggregateId->value] = true; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php index 489c0ba848c..6d347b52a12 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/ParentsUntilOperation.php @@ -83,8 +83,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) foreach ($parentNodes as $parentNode) { if ($parentNode !== null - && !isset($outputNodeAggregateIds[(string)$parentNode->nodeAggregateId])) { - $outputNodeAggregateIds[(string)$parentNode->nodeAggregateId] = true; + && !isset($outputNodeAggregateIds[$parentNode->nodeAggregateId->value])) { + $outputNodeAggregateIds[$parentNode->nodeAggregateId->value] = true; $output[] = $parentNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php index 4c152a249d9..81a1a8afb22 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevAllOperation.php @@ -71,9 +71,9 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) foreach ($flowQuery->getContext() as $contextNode) { foreach ($this->getPrevForNode($contextNode) as $prevNode) { if ($prevNode !== null - && !isset($outputNodeAggregateIds[(string)$prevNode->nodeAggregateId]) + && !isset($outputNodeAggregateIds[$prevNode->nodeAggregateId->value]) ) { - $outputNodeAggregateIds[(string)$prevNode->nodeAggregateId] = true; + $outputNodeAggregateIds[$prevNode->nodeAggregateId->value] = true; $output[] = $prevNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php index eacb45e1430..c8e885f8393 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevOperation.php @@ -69,8 +69,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void $outputNodePaths = []; foreach ($flowQuery->getContext() as $contextNode) { $nextNode = $this->getPrevForNode($contextNode); - if ($nextNode !== null && !isset($outputNodePaths[(string)$nextNode->nodeAggregateId])) { - $outputNodePaths[(string)$nextNode->nodeAggregateId] = true; + if ($nextNode !== null && !isset($outputNodePaths[$nextNode->nodeAggregateId->value])) { + $outputNodePaths[$nextNode->nodeAggregateId->value] = true; $output[] = $nextNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php index 25e477c4218..fe1dea0f61c 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PrevUntilOperation.php @@ -88,8 +88,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void foreach ($prevNodes as $prevNode) { if ($prevNode !== null && - !isset($outputNodeIdentifiers[(string)$prevNode->nodeAggregateId])) { - $outputNodeIdentifiers[(string)$prevNode->nodeAggregateId] = true; + !isset($outputNodeIdentifiers[$prevNode->nodeAggregateId->value])) { + $outputNodeIdentifiers[$prevNode->nodeAggregateId->value] = true; $output[] = $prevNode; } } diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php index 45706eacbf6..12467995ae8 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/PropertyOperation.php @@ -93,7 +93,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $element = $context[0]; $subgraph = $this->contentRepositoryRegistry->subgraphForNode($element); if ($propertyPath === '_path') { - return (string)$subgraph->retrieveNodePath($element->nodeAggregateId); + return $subgraph->retrieveNodePath($element->nodeAggregateId)->value; } elseif ($propertyPath[0] === '_') { return ObjectAccess::getPropertyPath($element, substr($propertyPath, 1)); } else { diff --git a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php index 50b18c13619..d25894deee4 100644 --- a/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php +++ b/Neos.ContentRepository.NodeAccess/Classes/FlowQueryOperations/SiblingsOperation.php @@ -68,7 +68,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void $outputNodeAggregateIds = []; foreach ($flowQuery->getContext() as $contextNode) { /** @var Node $contextNode */ - $outputNodeAggregateIds[(string)$contextNode->nodeAggregateId] = true; + $outputNodeAggregateIds[$contextNode->nodeAggregateId->value] = true; } foreach ($flowQuery->getContext() as $contextNode) { @@ -83,9 +83,9 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void foreach ( $subgraph->findChildNodes($parentNode->nodeAggregateId, FindChildNodesFilter::create()) as $childNode ) { - if (!isset($outputNodeAggregateIds[(string)$childNode->nodeAggregateId])) { + if (!isset($outputNodeAggregateIds[$childNode->nodeAggregateId->value])) { $output[] = $childNode; - $outputNodeAggregateIds[(string)$childNode->nodeAggregateId] = true; + $outputNodeAggregateIds[$childNode->nodeAggregateId->value] = true; } } } diff --git a/Neos.ContentRepository.Security/Classes/Authorization/Privilege/Node/NodePrivilegeContext.php b/Neos.ContentRepository.Security/Classes/Authorization/Privilege/Node/NodePrivilegeContext.php index 04ae4518624..49c1bc39ee2 100644 --- a/Neos.ContentRepository.Security/Classes/Authorization/Privilege/Node/NodePrivilegeContext.php +++ b/Neos.ContentRepository.Security/Classes/Authorization/Privilege/Node/NodePrivilegeContext.php @@ -61,7 +61,7 @@ public function isAncestorNodeOf(string $nodePathOrIdentifier): bool return $nodePathOrResult; } - return str_starts_with($nodePathOrResult, (string)$this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId)); + return str_starts_with($nodePathOrResult, $this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId)->value); } /** @@ -80,7 +80,7 @@ public function isDescendantNodeOf(string $nodePathOrIdentifier): bool return $nodePathOrResult; } - return str_starts_with((string)$this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId), $nodePathOrResult); + return str_starts_with($this->getSubgraph()->retrieveNodePath($this->node->nodeAggregateId)->value, $nodePathOrResult); } /** @@ -138,7 +138,7 @@ public function isInWorkspace(array $workspaceNames): bool $workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId( $this->node->subgraphIdentity->contentStreamId ); - return !is_null($workspace) && in_array((string)$workspace->workspaceName, $workspaceNames); + return !is_null($workspace) && in_array($workspace->workspaceName->value, $workspaceNames); } /** @@ -186,7 +186,7 @@ protected function resolveNodePathOrResult(string $nodePathOrIdentifier): bool|s if (is_null($otherNode)) { return false; } - return $this->getSubgraph()->retrieveNodePath($otherNode->nodeAggregateId) . '/'; + return $this->getSubgraph()->retrieveNodePath($otherNode->nodeAggregateId)->value . '/'; } catch (\InvalidArgumentException $e) { return rtrim($nodePathOrIdentifier, '/') . '/'; } diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/LoadNodeTypeTrait.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/LoadNodeTypeTrait.php index 3963999e930..8628a45ac07 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/LoadNodeTypeTrait.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/LoadNodeTypeTrait.php @@ -22,7 +22,7 @@ abstract protected function getNodeTypeManager(): NodeTypeManager; protected function loadNodeType(NodeTypeName $nodeTypeName): ?NodeType { try { - $nodeType = $this->getNodeTypeManager()->getNodeType((string)$nodeTypeName); + $nodeType = $this->getNodeTypeManager()->getNodeType($nodeTypeName->value); if ($nodeType->getName() !== $nodeTypeName->jsonSerialize()) { // the $nodeTypeName was different than the fetched node type; so that means // that the FallbackNodeType has been returned. diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index a5ef4788d10..7712a228eb1 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -79,7 +79,7 @@ public function findAdjustmentsForNodeType(NodeTypeName $nodeTypeName): \Generat yield StructureAdjustment::createForNode( $node, StructureAdjustment::TETHERED_NODE_MISSING, - 'The tethered child node "' . $tetheredNodeName . '" is missing.', + 'The tethered child node "' . $tetheredNodeName->value . '" is missing.', function () use ($nodeAggregate, $node, $tetheredNodeName, $expectedTetheredNodeType) { $events = $this->createEventsForMissingTetheredNode( $nodeAggregate, @@ -114,13 +114,13 @@ function () use ($nodeAggregate, $node, $tetheredNodeName, $expectedTetheredNode ); foreach ($tetheredNodeAggregates as $tetheredNodeAggregate) { /* @var $tetheredNodeAggregate NodeAggregate */ - if (!isset($expectedTetheredNodes[(string)$tetheredNodeAggregate->nodeName])) { + if (!isset($expectedTetheredNodes[$tetheredNodeAggregate->nodeName->value])) { $foundMissingOrDisallowedTetheredNodes = true; yield StructureAdjustment::createForNodeAggregate( $tetheredNodeAggregate, StructureAdjustment::DISALLOWED_TETHERED_NODE, 'The tethered child node "' - . $tetheredNodeAggregate->nodeName . '" should be removed.', + . $tetheredNodeAggregate->nodeName->value . '" should be removed.', function () use ($tetheredNodeAggregate) { return $this->removeNodeAggregate($tetheredNodeAggregate); } @@ -143,7 +143,7 @@ function () use ($tetheredNodeAggregate) { $actualTetheredChildNodes = []; foreach ($childNodes as $childNode) { if ($childNode->classification->isTethered()) { - $actualTetheredChildNodes[(string)$childNode->nodeName] = $childNode; + $actualTetheredChildNodes[$childNode->nodeName->value] = $childNode; } } @@ -194,7 +194,7 @@ private function ensureNodeIsOfType(Node $node, NodeType $expectedNodeType): \Ge yield StructureAdjustment::createForNode( $node, StructureAdjustment::TETHERED_NODE_TYPE_WRONG, - 'should be of type "' . $expectedNodeType . '", but was "' . $node->nodeTypeName->value . '".' + 'should be of type "' . $expectedNodeType->name . '", but was "' . $node->nodeTypeName->value . '".' ); } } diff --git a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php index 54ea0407545..e109dd8f8de 100644 --- a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php +++ b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacyBaseWorkspace.php @@ -38,7 +38,7 @@ public function getName(): string LogEnvironment::fromMethodName(__METHOD__) ); - return (string)$this->childWorkspace->baseWorkspaceName; + return $this->childWorkspace->baseWorkspaceName->value; } /** diff --git a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacySite.php b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacySite.php index 5bcc9228c29..d9ad313aa96 100644 --- a/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacySite.php +++ b/Neos.EventSourcedContentRepository.LegacyApi/Classes/ContextInNodeBasedReadModel/EmulatedLegacySite.php @@ -50,7 +50,7 @@ public function getSiteResourcesPackageKey(): ?string $siteNodeName = $siteNode->nodeName; /* @var ?Site $site */ - $site = $siteNodeName ? $this->siteRepository->findOneByNodeName((string)$siteNodeName) : null; + $site = $siteNodeName ? $this->siteRepository->findOneByNodeName($siteNodeName->value) : null; return $site?->getSiteResourcesPackageKey(); } diff --git a/Neos.EventSourcedContentRepository.LegacyApi/Classes/FlowQueryContextOperation/ContextOperation.php b/Neos.EventSourcedContentRepository.LegacyApi/Classes/FlowQueryContextOperation/ContextOperation.php index 71941aeac09..d4f6ac6fbf0 100644 --- a/Neos.EventSourcedContentRepository.LegacyApi/Classes/FlowQueryContextOperation/ContextOperation.php +++ b/Neos.EventSourcedContentRepository.LegacyApi/Classes/FlowQueryContextOperation/ContextOperation.php @@ -120,7 +120,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void ) ->findNodeById($contextNode->nodeAggregateId); if ($nodeInModifiedSubgraph !== null) { - $output[$nodeInModifiedSubgraph->nodeAggregateId->__toString()] = $nodeInModifiedSubgraph; + $output[$nodeInModifiedSubgraph->nodeAggregateId->value] = $nodeInModifiedSubgraph; } } diff --git a/Neos.Neos/Classes/Aspects/PluginUriAspect.php b/Neos.Neos/Classes/Aspects/PluginUriAspect.php index d5e367a6bc1..73b6846302b 100644 --- a/Neos.Neos/Classes/Aspects/PluginUriAspect.php +++ b/Neos.Neos/Classes/Aspects/PluginUriAspect.php @@ -81,7 +81,7 @@ public function rewritePluginViewUris(JoinPointInterface $joinPoint) $subgraph = $this->contentRepositoryRegistry->subgraphForNode($targetNode); $documentNode = $targetNode; while ($documentNode instanceof Node) { - if ($documentNode->nodeType->isOfType((string)NodeTypeNameFactory::forDocument())) { + if ($documentNode->nodeType->isOfType(NodeTypeNameFactory::forDocument()->value)) { break; } $documentNode = $subgraph->findParentNode($documentNode->nodeAggregateId); diff --git a/Neos.Neos/Classes/Controller/Backend/ContentController.php b/Neos.Neos/Classes/Controller/Backend/ContentController.php index c92802e8a20..976864a65f7 100644 --- a/Neos.Neos/Classes/Controller/Backend/ContentController.php +++ b/Neos.Neos/Classes/Controller/Backend/ContentController.php @@ -484,7 +484,7 @@ public function masterPluginsAction(string $workspaceName = 'live', array $dimen continue; } $translationHelper = new TranslationHelper(); - $masterPlugins[(string)$pluginNode->nodeAggregateId] = $translationHelper->translate( + $masterPlugins[$pluginNode->nodeAggregateId->value] = $translationHelper->translate( 'masterPlugins.nodeTypeOnPageLabel', null, [ diff --git a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php index 201009728bf..58196d97ea5 100644 --- a/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php +++ b/Neos.Neos/Classes/Controller/Module/Management/WorkspacesController.php @@ -138,7 +138,7 @@ public function indexAction() /** @var \Neos\ContentRepository\Core\Projection\Workspace\Workspace $workspace */ // FIXME: This check should be implemented through a specialized Workspace Privilege or something similar if (!$workspace->isPersonalWorkspace() && ($workspace->isInternalWorkspace() || $this->domainUserService->currentUserCanManageWorkspace($workspace))) { - $workspaceName = (string)$workspace->workspaceName; + $workspaceName = $workspace->workspaceName->value; $workspacesAndCounts[$workspaceName]['workspace'] = $workspace; $workspacesAndCounts[$workspaceName]['changesCounts'] = $this->computeChangesCount($workspace, $contentRepository); @@ -220,12 +220,12 @@ public function createAction( $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); $workspaceName = WorkspaceName::fromString( - Utility::renderValidNodeName((string)$title) . '-' + Utility::renderValidNodeName($title->value) . '-' . substr(base_convert(microtime(false), 10, 36), -5, 5) ); while ($contentRepository->getWorkspaceFinder()->findOneByName($workspaceName) instanceof Workspace) { $workspaceName = WorkspaceName::fromString( - Utility::renderValidNodeName((string)$title) . '-' + Utility::renderValidNodeName($title->value) . '-' . substr(base_convert(microtime(false), 10, 36), -5, 5) ); } @@ -318,7 +318,7 @@ public function updateAction(Workspace $workspace) #$this->workspaceFinder->update($workspace); $this->addFlashMessage($this->translator->translateById( 'workspaces.workspaceHasBeenUpdated', - [(string)$workspace->workspaceTitle], + [$workspace->workspaceTitle->value], null, null, 'Modules', @@ -349,12 +349,12 @@ public function deleteAction(Workspace $workspace) $dependentWorkspaceTitles = []; /** @var Workspace $dependentWorkspace */ foreach ($dependentWorkspaces as $dependentWorkspace) { - $dependentWorkspaceTitles[] = (string)$dependentWorkspace->workspaceTitle; + $dependentWorkspaceTitles[] = $dependentWorkspace->workspaceTitle->value; } $message = $this->translator->translateById( 'workspaces.workspaceCannotBeDeletedBecauseOfDependencies', - [(string)$workspace->workspaceTitle, implode(', ', $dependentWorkspaceTitles)], + [$workspace->workspaceTitle->value, implode(', ', $dependentWorkspaceTitles)], null, null, 'Modules', @@ -383,7 +383,7 @@ public function deleteAction(Workspace $workspace) //if ($nodesCount > 0) { $message = $this->translator->translateById( 'workspaces.workspaceCannotBeDeletedBecauseOfUnpublishedNodes', - [(string)$workspace->workspaceTitle, $nodesCount], + [$workspace->workspaceTitle->value, $nodesCount], $nodesCount, null, 'Modules', @@ -396,7 +396,7 @@ public function deleteAction(Workspace $workspace) //$this->workspaceFinder->remove($workspace); $this->addFlashMessage($this->translator->translateById( 'workspaces.workspaceHasBeenRemoved', - [(string)$workspace->workspaceTitle], + [$workspace->workspaceTitle->value], null, null, 'Modules', @@ -736,7 +736,7 @@ protected function computeSiteChanges(Workspace $selectedWorkspace, ContentRepos $node = $subgraph->findNodeById($change->nodeAggregateId); if ($node) { - $pathParts = explode('/', (string)$subgraph->retrieveNodePath($node->nodeAggregateId)); + $pathParts = explode('/', $subgraph->retrieveNodePath($node->nodeAggregateId)->value); if (count($pathParts) > 2) { $siteNodeName = $pathParts[2]; $document = null; @@ -757,12 +757,12 @@ protected function computeSiteChanges(Workspace $selectedWorkspace, ContentRepos assert($document instanceof Node); $documentPath = implode('/', array_slice(explode( '/', - (string)$subgraph->retrieveNodePath($document->nodeAggregateId) + $subgraph->retrieveNodePath($document->nodeAggregateId)->value ), 3)); $relativePath = str_replace( sprintf('//%s/%s', $siteNodeName, $documentPath), '', - (string)$subgraph->retrieveNodePath($node->nodeAggregateId) + $subgraph->retrieveNodePath($node->nodeAggregateId)->value ); if (!isset($siteChanges[$siteNodeName]['siteNode'])) { $siteChanges[$siteNodeName]['siteNode'] @@ -1036,7 +1036,7 @@ protected function prepareBaseWorkspaceOptions( || $this->domainUserService->currentUserCanManageWorkspace($workspace)) && (!$excludedWorkspace || $workspaces->getBaseWorkspaces($workspace->workspaceName)->get($excludedWorkspace->workspaceName) === null) ) { - $baseWorkspaceOptions[(string)$workspace->workspaceName] = (string)$workspace->workspaceTitle; + $baseWorkspaceOptions[$workspace->workspaceName->value] = $workspace->workspaceTitle->value; } } diff --git a/Neos.Neos/Classes/Controller/Service/NodesController.php b/Neos.Neos/Classes/Controller/Service/NodesController.php index 7f10944f493..0ed79a08dfa 100644 --- a/Neos.Neos/Classes/Controller/Service/NodesController.php +++ b/Neos.Neos/Classes/Controller/Service/NodesController.php @@ -402,7 +402,7 @@ protected function adoptNodeAndParents( // so we need to load it from the source subgraph $sourceNode = $sourceSubgraph->findNodeById($identifier); if (!$sourceNode) { - throw new \RuntimeException('Source node for Node Aggregate ID ' . $identifier + throw new \RuntimeException('Source node for Node Aggregate ID ' . $identifier->value . ' not found. This should never happen.', 1660905374); } $contentRepository->handle( diff --git a/Neos.Neos/Classes/Domain/Exception/SiteNodeNameIsAlreadyInUseByAnotherSite.php b/Neos.Neos/Classes/Domain/Exception/SiteNodeNameIsAlreadyInUseByAnotherSite.php index 8703b153694..3644bacb085 100644 --- a/Neos.Neos/Classes/Domain/Exception/SiteNodeNameIsAlreadyInUseByAnotherSite.php +++ b/Neos.Neos/Classes/Domain/Exception/SiteNodeNameIsAlreadyInUseByAnotherSite.php @@ -23,7 +23,7 @@ final class SiteNodeNameIsAlreadyInUseByAnotherSite extends \DomainException public static function butWasAttemptedToBeClaimed(NodeName $nodeName): self { return new self( - 'Site node name ' . $nodeName . ' is already in use by another site', + 'Site node name ' . $nodeName->value . ' is already in use by another site', 1651962963 ); } diff --git a/Neos.Neos/Classes/Domain/Exception/SiteNodeTypeIsInvalid.php b/Neos.Neos/Classes/Domain/Exception/SiteNodeTypeIsInvalid.php index ea0e02e108b..ed29ca17d87 100644 --- a/Neos.Neos/Classes/Domain/Exception/SiteNodeTypeIsInvalid.php +++ b/Neos.Neos/Classes/Domain/Exception/SiteNodeTypeIsInvalid.php @@ -24,8 +24,8 @@ final class SiteNodeTypeIsInvalid extends \DomainException public static function becauseItIsNotOfTypeSite(NodeTypeName $attemptedNodeTypeName): self { return new self( - 'Node type name "' . $attemptedNodeTypeName - . '" is not of required type "' . NodeTypeNameFactory::forSite() . '"', + 'Node type name "' . $attemptedNodeTypeName->value + . '" is not of required type "' . NodeTypeNameFactory::forSite()->value . '"', 1412372375 ); } diff --git a/Neos.Neos/Classes/Domain/Exception/SitesNodeIsMissing.php b/Neos.Neos/Classes/Domain/Exception/SitesNodeIsMissing.php index e94da263eab..ee2cea42256 100644 --- a/Neos.Neos/Classes/Domain/Exception/SitesNodeIsMissing.php +++ b/Neos.Neos/Classes/Domain/Exception/SitesNodeIsMissing.php @@ -23,7 +23,7 @@ final class SitesNodeIsMissing extends \DomainException public static function butWasRequested(): self { return new self( - 'The "' . NodeTypeNameFactory::forSites() . '" root node is missing.', + 'The "' . NodeTypeNameFactory::forSites()->value . '" root node is missing.', 1651956364 ); } diff --git a/Neos.Neos/Classes/Domain/Service/FusionService.php b/Neos.Neos/Classes/Domain/Service/FusionService.php index ab2b1c08318..00931ab86aa 100644 --- a/Neos.Neos/Classes/Domain/Service/FusionService.php +++ b/Neos.Neos/Classes/Domain/Service/FusionService.php @@ -165,7 +165,7 @@ public function getMergedFusionObjectTree(Node $startNode) protected function getSiteForSiteNode(Node $siteNode): ?Site { - return $this->siteRepository->findOneByNodeName((string)$siteNode->nodeName); + return $this->siteRepository->findOneByNodeName($siteNode->nodeName->value); } /** diff --git a/Neos.Neos/Classes/Domain/Service/SiteService.php b/Neos.Neos/Classes/Domain/Service/SiteService.php index 82664e3a7a6..bcd07a09439 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteService.php +++ b/Neos.Neos/Classes/Domain/Service/SiteService.php @@ -127,7 +127,7 @@ public function assignUploadedAssetToSiteAssetCollection(Asset $asset, Node $nod return; } - $site = $this->siteRepository->findOneByNodeName((string)$siteNode->nodeName); + $site = $this->siteRepository->findOneByNodeName($siteNode->nodeName->value); if ($site === null) { return; } @@ -164,7 +164,7 @@ public function createSite( } // @todo use node aggregate identifier instead of node name - $site = new Site((string)$siteNodeName); + $site = new Site($siteNodeName->value); $site->setSiteResourcesPackageKey($packageKey); $site->setState($inactive ? Site::STATE_OFFLINE : Site::STATE_ONLINE); $site->setName($siteName); diff --git a/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php b/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php index b06570e99df..9ad9261ce83 100644 --- a/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php +++ b/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php @@ -59,7 +59,7 @@ public function removeSiteNode(SiteNodeName $siteNodeName): void $arbitraryDimensionSpacePoint = reset($dimensionSpacePoints) ?: null; if (!$arbitraryDimensionSpacePoint instanceof DimensionSpacePoint) { throw new \InvalidArgumentException( - 'Cannot prune site "' . $siteNodeName->toNodeName() + 'Cannot prune site "' . $siteNodeName->toNodeName()->value . '" due to the dimension space being empty', 1651921482 ); diff --git a/Neos.Neos/Classes/Eel/FlowQueryOperations/SortOperation.php b/Neos.Neos/Classes/Eel/FlowQueryOperations/SortOperation.php index fe2b857a95c..4f63e806a84 100644 --- a/Neos.Neos/Classes/Eel/FlowQueryOperations/SortOperation.php +++ b/Neos.Neos/Classes/Eel/FlowQueryOperations/SortOperation.php @@ -123,8 +123,8 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $propertyValue = $propertyValue->getTimestamp(); } - $sortSequence[(string)$node->nodeAggregateId] = $propertyValue; - $nodesByIdentifier[(string)$node->nodeAggregateId] = $node; + $sortSequence[$node->nodeAggregateId->value] = $propertyValue; + $nodesByIdentifier[$node->nodeAggregateId->value] = $node; } // Create the sort sequence diff --git a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php index 5c4baafaac1..46c8e466401 100644 --- a/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php +++ b/Neos.Neos/Classes/FrontendRouting/DimensionResolution/Resolver/UriPathResolver.php @@ -85,7 +85,7 @@ private static function validate( $contentDimension = $contentDimensionSource->getDimension($segment->dimensionIdentifier); if ($contentDimension === null) { throw new UriPathResolverConfigurationException( - 'Content Dimension "' . $segment->dimensionIdentifier . '" does not exist.' + 'Content Dimension "' . $segment->dimensionIdentifier->value . '" does not exist.' ); } @@ -93,7 +93,7 @@ private static function validate( if ($contentDimension->getValue($mappingElement->dimensionValue->value) === null) { throw new UriPathResolverConfigurationException( 'Content Dimension Value "' . $mappingElement->dimensionValue->value - . '" in dimension "' . $segment->dimensionIdentifier->id . '" does not exist.' + . '" in dimension "' . $segment->dimensionIdentifier->value . '" does not exist.' ); } @@ -159,7 +159,7 @@ private static function cartesian(Segments $segments): array foreach ($result as $product) { foreach ($segment->uriPathSegmentMapping as $item) { - $product[$segment->dimensionIdentifier->id] = $item; + $product[$segment->dimensionIdentifier->value] = $item; $append[] = $product; } } @@ -244,7 +244,7 @@ private function reduceDimensionSpacePointToConfiguredDimensions(DimensionSpaceP foreach ($this->segments->segments as $segment) { $coordinateValue = $incoming->getCoordinate($segment->dimensionIdentifier); if ($coordinateValue !== null) { - $newCoordinates[$segment->dimensionIdentifier->id] = $coordinateValue; + $newCoordinates[$segment->dimensionIdentifier->value] = $coordinateValue; } } return DimensionSpacePoint::fromArray($newCoordinates); diff --git a/Neos.Neos/Classes/FrontendRouting/NodeAddressFactory.php b/Neos.Neos/Classes/FrontendRouting/NodeAddressFactory.php index 138fc9172c8..e1328d8c1c4 100644 --- a/Neos.Neos/Classes/FrontendRouting/NodeAddressFactory.php +++ b/Neos.Neos/Classes/FrontendRouting/NodeAddressFactory.php @@ -43,8 +43,8 @@ public function createFromNode(Node $node): NodeAddress ); if ($workspace === null) { throw new \RuntimeException( - 'Cannot build a NodeAddress for traversable node of aggregate ' . $node->nodeAggregateId - . ', because the content stream ' . $node->subgraphIdentity->contentStreamId + 'Cannot build a NodeAddress for traversable node of aggregate ' . $node->nodeAggregateId->value + . ', because the content stream ' . $node->subgraphIdentity->contentStreamId->value . ' is not assigned to a workspace.' ); } diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index b097fe55cf3..35ff6354951 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -316,7 +316,7 @@ private function whenNodeAggregateWithNodeWasCreated(NodeAggregateWithNodeWasCre } $nodeAggregateIdPath = $parentNode->getNodeAggregateIdPath() - . '/' . $event->nodeAggregateId; + . '/' . $event->nodeAggregateId->value; if ($parentNode->isRoot() && $event->nodeName !== null) { $uriPath = ''; $siteNodeName = SiteNodeName::fromNodeName($event->nodeName); diff --git a/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php b/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php index 4282800d840..6efbde6675e 100644 --- a/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php +++ b/Neos.Neos/Classes/Fusion/Cache/ContentCacheFlusher.php @@ -114,8 +114,8 @@ public function flushNodeAggregate( } $processedNodeAggregateIds[$nodeAggregate->nodeAggregateId->value] = true; - $tagName = 'DescendantOf_%' . $nodeAggregate->contentStreamId - . '%_' . $nodeAggregate->nodeAggregateId; + $tagName = 'DescendantOf_%' . $nodeAggregate->contentStreamId->value + . '%_' . $nodeAggregate->nodeAggregateId->value; $tagsToFlush[$tagName] = sprintf( 'which were tagged with "%s" because node "%s" has changed.', $tagName, @@ -123,7 +123,7 @@ public function flushNodeAggregate( ); // Legacy - $legacyTagName = 'DescendantOf_' . $nodeAggregate->nodeAggregateId; + $legacyTagName = 'DescendantOf_' . $nodeAggregate->nodeAggregateId->value; $tagsToFlush[$legacyTagName] = sprintf( 'which were tagged with legacy "%s" because node "%s" has changed.', $legacyTagName, @@ -156,7 +156,7 @@ private function registerChangeOnNodeIdentifier( NodeAggregateId $nodeAggregateId, array &$tagsToFlush ): void { - $cacheIdentifier = '%' . $contentStreamId . '%_' . $nodeAggregateId; + $cacheIdentifier = '%' . $contentStreamId->value . '%_' . $nodeAggregateId->value; $tagsToFlush['Node_' . $cacheIdentifier] = sprintf( 'which were tagged with "Node_%s" because that identifier has changed.', $cacheIdentifier @@ -169,7 +169,7 @@ private function registerChangeOnNodeIdentifier( ); // Legacy - $cacheIdentifier = (string)$nodeAggregateId; + $cacheIdentifier = $nodeAggregateId->value; $tagsToFlush['Node_' . $cacheIdentifier] = sprintf( 'which were tagged with "Node_%s" because that identifier has changed.', $cacheIdentifier @@ -198,15 +198,15 @@ private function registerChangeOnNodeType( ): void { try { $nodeTypesToFlush = $this->getAllImplementedNodeTypeNames( - $contentRepository->getNodeTypeManager()->getNodeType((string)$nodeTypeName) + $contentRepository->getNodeTypeManager()->getNodeType($nodeTypeName->value) ); } catch (NodeTypeNotFoundException $e) { // as a fallback, we flush the single NodeType - $nodeTypesToFlush = [(string)$nodeTypeName]; + $nodeTypesToFlush = [$nodeTypeName->value]; } foreach ($nodeTypesToFlush as $nodeTypeNameToFlush) { - $tagsToFlush['NodeType_%' . $contentStreamId . '%_' . $nodeTypeNameToFlush] = sprintf( + $tagsToFlush['NodeType_%' . $contentStreamId->value . '%_' . $nodeTypeNameToFlush] = sprintf( 'which were tagged with "NodeType_%s" because node "%s" has changed and was of type "%s".', $nodeTypeNameToFlush, ($referenceNodeIdentifier ?: ''), diff --git a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php index 8cc772edd06..89dc4a75288 100644 --- a/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php +++ b/Neos.Neos/Classes/Fusion/DimensionsMenuItemsImplementation.php @@ -206,7 +206,7 @@ function (&$dimensionValue, $rawDimensionIdentifier) use ($dimensionMenuItemsImp protected function determineLabel(?Node $variant = null, array $metadata = []): string { if ($this->getContentDimensionIdentifierToLimitTo()) { - return $metadata[(string)$this->getContentDimensionIdentifierToLimitTo()]['label'] ?: ''; + return $metadata[$this->getContentDimensionIdentifierToLimitTo()->value]['label'] ?: ''; } else { if ($variant) { return $variant->getLabel() ?: ''; diff --git a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php index f8a3e738783..33889e702d7 100644 --- a/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php +++ b/Neos.Neos/Classes/Fusion/Helper/CachingHelper.php @@ -63,7 +63,7 @@ protected function convertArrayOfNodesToArrayOfNodeIdentifiersWithPrefix(mixed $ if ($node instanceof Node) { $prefixedNodeIdentifiers[] = $prefix . '_' . $this->renderContentStreamIdTag($node->subgraphIdentity->contentStreamId) - . '_' . $node->nodeAggregateId; + . '_' . $node->nodeAggregateId->value; } else { throw new Exception(sprintf( 'One of the elements in array passed to this helper was not a Node, but of type: "%s".', @@ -188,7 +188,7 @@ public function descendantOfTag(mixed $nodes): array */ private function renderContentStreamIdTag(ContentStreamId $contentStreamId) { - return '%' . $contentStreamId . '%'; + return '%' . $contentStreamId->value . '%'; } /** @@ -213,7 +213,7 @@ public function getWorkspaceChain(?Node $node): array $workspaceChain = []; // TODO: Maybe write CTE here while ($currentWorkspace instanceof Workspace) { - $workspaceChain[(string)$currentWorkspace->workspaceName] = $currentWorkspace; + $workspaceChain[$currentWorkspace->workspaceName->value] = $currentWorkspace; $currentWorkspace = $currentWorkspace->baseWorkspaceName ? $contentRepository->getWorkspaceFinder()->findOneByName($currentWorkspace->baseWorkspaceName) : null; diff --git a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php index 0c236da1cc8..6f2cdd9da5a 100644 --- a/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php +++ b/Neos.Neos/Classes/Fusion/Helper/NodeLabelToken.php @@ -146,7 +146,7 @@ protected function resolveLabelFromNodeType(): void } if (empty($this->postfix) && $this->node->classification->isTethered()) { - $this->postfix = ' (' . $this->node->nodeName . ')'; + $this->postfix = ' (' . $this->node->nodeName->value . ')'; } } diff --git a/Neos.Neos/Classes/PendingChangesProjection/Change.php b/Neos.Neos/Classes/PendingChangesProjection/Change.php index 8f95402a915..374f1d8507e 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/Change.php +++ b/Neos.Neos/Classes/PendingChangesProjection/Change.php @@ -89,8 +89,8 @@ public function __construct( public function addToDatabase(Connection $databaseConnection, string $tableName): void { $databaseConnection->insert($tableName, [ - 'contentStreamId' => (string)$this->contentStreamId, - 'nodeAggregateId' => (string)$this->nodeAggregateId, + 'contentStreamId' => $this->contentStreamId->value, + 'nodeAggregateId' => $this->nodeAggregateId->value, 'originDimensionSpacePoint' => json_encode($this->originDimensionSpacePoint), 'originDimensionSpacePointHash' => $this->originDimensionSpacePoint->hash, 'changed' => (int)$this->changed, @@ -111,8 +111,8 @@ public function updateToDatabase(Connection $databaseConnection, string $tableNa 'removalAttachmentPoint' => $this->removalAttachmentPoint?->__toString() ], [ - 'contentStreamId' => (string)$this->contentStreamId, - 'nodeAggregateId' => (string)$this->nodeAggregateId, + 'contentStreamId' => $this->contentStreamId->value, + 'nodeAggregateId' => $this->nodeAggregateId->value, 'originDimensionSpacePoint' => json_encode($this->originDimensionSpacePoint), 'originDimensionSpacePointHash' => $this->originDimensionSpacePoint->hash, ] diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php index c91e4d45317..0bc48c0e98b 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeFinder.php @@ -50,7 +50,7 @@ public function findByContentStreamId(ContentStreamId $contentStreamId): array WHERE contentStreamId = :contentStreamId ', [ - ':contentStreamId' => (string)$contentStreamId + ':contentStreamId' => $contentStreamId->value ] )->fetchAll(); $changes = []; @@ -69,7 +69,7 @@ public function countByContentStreamId(ContentStreamId $contentStreamId): int WHERE contentStreamId = :contentStreamId ', [ - ':contentStreamId' => (string)$contentStreamId + ':contentStreamId' => $contentStreamId->value ] )->rowCount(); } diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 115321b1d1b..4cd73927799 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -276,8 +276,8 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo AND originDimensionSpacePointHash IN (:affectedDimensionSpacePointHashes) ', [ - 'contentStreamId' => (string)$event->contentStreamId, - 'nodeAggregateId' => (string)$event->nodeAggregateId, + 'contentStreamId' => $event->contentStreamId->value, + 'nodeAggregateId' => $event->nodeAggregateId->value, 'affectedDimensionSpacePointHashes' => $event->affectedCoveredDimensionSpacePoints ->getPointHashes() ], @@ -303,8 +303,8 @@ private function whenNodeAggregateWasRemoved(NodeAggregateWasRemoved $event): vo ) ', [ - 'contentStreamId' => (string)$event->contentStreamId, - 'nodeAggregateId' => (string)$event->nodeAggregateId, + 'contentStreamId' => $event->contentStreamId->value, + 'nodeAggregateId' => $event->nodeAggregateId->value, 'originDimensionSpacePoint' => json_encode($occupiedDimensionSpacePoint), 'originDimensionSpacePointHash' => $occupiedDimensionSpacePoint->hash, 'removalAttachmentPoint' => $event->removalAttachmentPoint?->__toString() @@ -331,7 +331,7 @@ private function whenDimensionSpacePointWasMoved(DimensionSpacePointWasMoved $ev 'originalDimensionSpacePointHash' => $event->source->hash, 'newDimensionSpacePointHash' => $event->target->hash, 'newDimensionSpacePoint' => json_encode($event->target->jsonSerialize()), - 'contentStreamId' => (string)$event->contentStreamId + 'contentStreamId' => $event->contentStreamId->value ] ); }); diff --git a/Neos.Neos/Classes/Presentation/Dimensions/VisualContentDimension.php b/Neos.Neos/Classes/Presentation/Dimensions/VisualContentDimension.php index cd440ce35fb..3e51d7ef6a5 100644 --- a/Neos.Neos/Classes/Presentation/Dimensions/VisualContentDimension.php +++ b/Neos.Neos/Classes/Presentation/Dimensions/VisualContentDimension.php @@ -78,8 +78,8 @@ public static function fromContentDimension( return new self( $offset, - (string)$contentDimension->id, - $contentDimension->getConfigurationValue('label') ?: (string)$contentDimension->id, + $contentDimension->id->value, + $contentDimension->getConfigurationValue('label') ?: $contentDimension->id->value, $nodes, $edges ); diff --git a/Neos.Neos/Classes/Presentation/Dimensions/VisualInterDimensionalVariationGraph.php b/Neos.Neos/Classes/Presentation/Dimensions/VisualInterDimensionalVariationGraph.php index cef90e65519..c8ce7a3095b 100644 --- a/Neos.Neos/Classes/Presentation/Dimensions/VisualInterDimensionalVariationGraph.php +++ b/Neos.Neos/Classes/Presentation/Dimensions/VisualInterDimensionalVariationGraph.php @@ -48,7 +48,7 @@ public static function forInterDimensionalVariationGraph( $height = 0; foreach ($contentDimensionSource->getContentDimensionsOrderedByPriority() as $contentDimension) { - $identifier = (string)$contentDimension->id; + $identifier = $contentDimension->id->value; $offsets[$identifier] = self::resolveOffsets($contentDimension); } @@ -61,7 +61,7 @@ public static function forInterDimensionalVariationGraph( $previousDepthFactor = 1; $previousWidthFactor = 1; foreach (array_reverse($dimensionSpacePoint->dimensionValues) as $dimensionIdentifier => $dimensionValue) { - $y += $dimensionValue->specializationDepth->depth * $previousDepthFactor; + $y += $dimensionValue->specializationDepth->value * $previousDepthFactor; $previousDepthFactor *= $offsets[$dimensionIdentifier]['_height']; $x += $offsets[$dimensionIdentifier][$dimensionValue->value]['x'] * $previousWidthFactor; diff --git a/Neos.Neos/Classes/Presentation/Dimensions/VisualIntraDimensionalVariationGraph.php b/Neos.Neos/Classes/Presentation/Dimensions/VisualIntraDimensionalVariationGraph.php index 5fcc079ade0..1217476e6df 100644 --- a/Neos.Neos/Classes/Presentation/Dimensions/VisualIntraDimensionalVariationGraph.php +++ b/Neos.Neos/Classes/Presentation/Dimensions/VisualIntraDimensionalVariationGraph.php @@ -40,7 +40,7 @@ public static function fromContentDimensionSource(ContentDimensionSourceInterfac $height = 0; foreach ($contentDimensionSource->getContentDimensionsOrderedByPriority() as $contentDimension) { - $dimensions[(string)$contentDimension->id] = VisualContentDimension::fromContentDimension( + $dimensions[$contentDimension->id->value] = VisualContentDimension::fromContentDimension( $contentDimension, $horizontalOffset, $counter, diff --git a/Neos.Neos/Classes/Routing/Cache/RouteCacheFlusher.php b/Neos.Neos/Classes/Routing/Cache/RouteCacheFlusher.php index 01cc2c84452..be49d9cf6cf 100644 --- a/Neos.Neos/Classes/Routing/Cache/RouteCacheFlusher.php +++ b/Neos.Neos/Classes/Routing/Cache/RouteCacheFlusher.php @@ -46,7 +46,7 @@ class RouteCacheFlusher */ public function registerNodeChange(Node $node) { - $identifier = (string)$node->nodeAggregateId; + $identifier = $node->nodeAggregateId->value; if (in_array($identifier, $this->tagsToFlush)) { return; } @@ -72,7 +72,7 @@ public function registerBaseWorkspaceChange( Workspace $oldBaseWorkspace = null, Workspace $newBaseWorkspace = null ) { - $identifier = (string)$workspace->workspaceName; + $identifier = $workspace->workspaceName->value; if (!in_array($identifier, $this->tagsToFlush)) { $this->tagsToFlush[] = $identifier; } diff --git a/Neos.Neos/Classes/Service/ContentElementWrappingService.php b/Neos.Neos/Classes/Service/ContentElementWrappingService.php index 7620c03b311..70151b2284b 100644 --- a/Neos.Neos/Classes/Service/ContentElementWrappingService.php +++ b/Neos.Neos/Classes/Service/ContentElementWrappingService.php @@ -194,7 +194,7 @@ protected function addGenericEditingMetadata(array $attributes, Node $node): arr $nodeAddress = NodeAddressFactory::create($contentRepository)->createFromNode($node); $attributes['typeof'] = 'typo3:' . $node->nodeType->getName(); $attributes['about'] = $nodeAddress->serializeForUri(); - $attributes['data-node-_identifier'] = (string)$node->nodeAggregateId; + $attributes['data-node-_identifier'] = $node->nodeAggregateId->value; $attributes['data-node-__workspace-name'] = $nodeAddress->workspaceName; $attributes['data-node-__label'] = $node->getLabel(); @@ -372,7 +372,7 @@ protected function appendNonRenderedContentNodeMetadata(Node $documentNode): voi continue; } - if (isset($this->renderedNodes[(string)$node->nodeAggregateId]) === false) { + if (isset($this->renderedNodes[$node->nodeAggregateId->value]) === false) { $serializedNode = json_encode($this->nodeInfoHelper->renderNode($node)); $nodeContextPath = $nodeAddressFactory->createFromNode($node)->serializeForUri(); /** @codingStandardsIgnoreStart */ diff --git a/Neos.Neos/Classes/Service/Mapping/NodeReferenceConverter.php b/Neos.Neos/Classes/Service/Mapping/NodeReferenceConverter.php index 53220589d47..aa4625ce7de 100644 --- a/Neos.Neos/Classes/Service/Mapping/NodeReferenceConverter.php +++ b/Neos.Neos/Classes/Service/Mapping/NodeReferenceConverter.php @@ -68,10 +68,10 @@ public function convertFrom( if (is_array($source)) { $result = []; foreach ($source as $node) { - $result[] = (string)$node->nodeAggregateId; + $result[] = $node->nodeAggregateId->value; } } else { - $result = (string)$source->nodeAggregateId; + $result = $source->nodeAggregateId->value; } return $result; diff --git a/Neos.Neos/Classes/Service/PluginService.php b/Neos.Neos/Classes/Service/PluginService.php index 4a230aa26e3..d4533dfeb11 100644 --- a/Neos.Neos/Classes/Service/PluginService.php +++ b/Neos.Neos/Classes/Service/PluginService.php @@ -73,7 +73,7 @@ public function getPluginNodesWithViewDefinitions( $workspace = $contentRepository->getWorkspaceFinder()->findOneByName($workspaceName); if (is_null($workspace)) { - throw new \InvalidArgumentException('Could not find workspace "' . $workspaceName . '"'); + throw new \InvalidArgumentException('Could not find workspace "' . $workspaceName->value . '"'); } $siteNode = $this->siteNodeUtility->findCurrentSiteNode( @@ -224,7 +224,7 @@ public function getPluginViewNodeByMasterPlugin(Node $node, string $viewName): ? ])) as $pluginViewNode ) { if ( - $pluginViewNode->getProperty('plugin') === (string)$node->nodeAggregateId + $pluginViewNode->getProperty('plugin') === $node->nodeAggregateId->value && $pluginViewNode->getProperty('view') === $viewName ) { return $pluginViewNode; diff --git a/Neos.Neos/Classes/Service/View/NodeView.php b/Neos.Neos/Classes/Service/View/NodeView.php index 3b8148d67cc..a3b7f230f90 100644 --- a/Neos.Neos/Classes/Service/View/NodeView.php +++ b/Neos.Neos/Classes/Service/View/NodeView.php @@ -285,8 +285,8 @@ protected function collectChildNodeData( $expand === false && $untilNode !== null && strpos( - (string)$subgraph->retrieveNodePath($untilNode->nodeAggregateId), - (string)$subgraph->retrieveNodePath($childNode->nodeAggregateId), + $subgraph->retrieveNodePath($untilNode->nodeAggregateId)->value, + $subgraph->retrieveNodePath($childNode->nodeAggregateId)->value, ) === 0 && $childNode !== $untilNode ) { @@ -351,11 +351,11 @@ protected function collectChildNodeData( public function collectParentNodeData(Node $rootNode, Nodes $nodes): array { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($rootNode); - $rootNodePath = (string)$subgraph->retrieveNodePath($rootNode->nodeAggregateId); + $rootNodePath = $subgraph->retrieveNodePath($rootNode->nodeAggregateId)->value; $nodeCollection = []; $addNode = function (Node $node, bool $matched) use ($subgraph, $rootNodePath, &$nodeCollection) { - $nodePath = (string)$subgraph->retrieveNodePath($node->nodeAggregateId); + $nodePath = $subgraph->retrieveNodePath($node->nodeAggregateId)->value; $path = str_replace('/', '.children.', substr($nodePath, strlen($rootNodePath) + 1)); if ($path !== '') { $nodeCollection = Arrays::setValueByPath($nodeCollection, $path . '.node', $node); diff --git a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php index 16b57afd014..66e9c3f1b53 100644 --- a/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php +++ b/Neos.Neos/Classes/Utility/NodeUriPathSegmentGenerator.php @@ -40,7 +40,7 @@ public function generateUriPathSegment(?Node $node = null, ?string $text = null) { $language = null; if ($node) { - $text = $text ?: $node->getLabel() ?: (string)$node->nodeName; + $text = $text ?: $node->getLabel() ?: $node->nodeName->value; $languageDimensionValue = $node->originDimensionSpacePoint->coordinates['language'] ?? null; if (!is_null($languageDimensionValue)) { $locale = new Locale($languageDimensionValue);