diff --git a/config/set/contentrepository-90.php b/config/set/contentrepository-90.php index 5735c03..1111e1a 100644 --- a/config/set/contentrepository-90.php +++ b/config/set/contentrepository-90.php @@ -50,6 +50,11 @@ use Neos\Rector\ContentRepository90\Rules\NodeTypeGetNameRector; use Neos\Rector\Generic\ValueObject\AddInjection; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; +use Neos\Neos\Domain\Service\RenderingModeService; +use Neos\Rector\ContentRepository90\Rules\ContextGetCurrentRenderingModeRector; +use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub; +use Neos\Rector\ContentRepository90\Rules\ContextIsLiveRector; +use Neos\Rector\ContentRepository90\Rules\ContextIsInBackendRector; return static function (RectorConfig $rectorConfig): void { // Register FusionFileProcessor. All Fusion Rectors will be auto-registered at this processor. @@ -64,9 +69,9 @@ $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ - 'Neos\\ContentRepository\\Domain\\Model\\NodeInterface' => Node::class, - 'Neos\\ContentRepository\\Domain\\Projection\\Content\\NodeInterface' => Node::class, - 'Neos\\ContentRepository\\Domain\\Projection\\Content\\TraversableNodeInterface' => Node::class, + 'Neos\\ContentRepository\\Domain\\Model\\NodeInterface' => NodeLegacyStub::class, + 'Neos\\ContentRepository\\Domain\\Projection\\Content\\NodeInterface' => NodeLegacyStub::class, + 'Neos\\ContentRepository\\Domain\\Projection\\Content\\TraversableNodeInterface' => NodeLegacyStub::class, 'Neos\ContentRepository\Domain\Service\Context' => LegacyContextStub::class, 'Neos\Neos\Domain\Service\ContentContext' => LegacyContextStub::class, @@ -92,37 +97,37 @@ */ // setName // getName - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getName', 'nodeName'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getName', 'nodeName'); // getLabel -> compatible with ES CR node (nothing to do) // setProperty // hasProperty -> compatible with ES CR Node (nothing to do) // getProperty -> compatible with ES CR Node (nothing to do) // removeProperty // getProperties -> PropertyCollectionInterface - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getProperties', 'properties'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getProperties', 'properties'); // getPropertyNames // setContentObject -> DEPRECATED / NON-FUNCTIONAL - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setContentObject', '!! Node::setContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setContentObject', '!! Node::setContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); // getContentObject -> DEPRECATED / NON-FUNCTIONAL - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getContentObject', '!! Node::getContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getContentObject', '!! Node::getContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); // unsetContentObject -> DEPRECATED / NON-FUNCTIONAL - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'unsetContentObject', '!! Node::unsetContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'unsetContentObject', '!! Node::unsetContentObject() is not supported by the new CR. Referencing objects can be done by storing them in Node::properties (and the serialization/deserialization is extensible).'); // setNodeType // getNodeType: NodeType - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getNodeType', 'nodeType'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getNodeType', 'nodeType'); // setHidden // isHidden $rectorConfig->rule(NodeIsHiddenRector::class); // TODO: Fusion NodeAccess // setHiddenBeforeDateTime - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setHiddenBeforeDateTime', '!! Node::setHiddenBeforeDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setHiddenBeforeDateTime', '!! Node::setHiddenBeforeDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); // getHiddenBeforeDateTime - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getHiddenBeforeDateTime', '!! Node::getHiddenBeforeDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getHiddenBeforeDateTime', '!! Node::getHiddenBeforeDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); $fusionNodePropertyPathToWarningComments[] = new FusionNodePropertyPathToWarningComment('hiddenBeforeDateTime', 'Line %LINE: !! node.hiddenBeforeDateTime is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); // setHiddenAfterDateTime - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setHiddenAfterDateTime', '!! Node::setHiddenAfterDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setHiddenAfterDateTime', '!! Node::setHiddenAfterDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); // getHiddenAfterDateTime - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getHiddenAfterDateTime', '!! Node::getHiddenAfterDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getHiddenAfterDateTime', '!! Node::getHiddenAfterDateTime() is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); $fusionNodePropertyPathToWarningComments[] = new FusionNodePropertyPathToWarningComment('hiddenAfterDateTime', 'Line %LINE: !! node.hiddenAfterDateTime is not supported by the new CR. Timed publishing will be implemented not on the read model, but by dispatching commands at a given time.'); // setHiddenInIndex // isHiddenInIndex @@ -130,9 +135,9 @@ // Fusion: .hiddenInIndex -> node.properties._hiddenInIndex $rectorConfig->rule(FusionNodeHiddenInIndexRector::class); // setAccessRoles - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setAccessRoles', '!! Node::setAccessRoles() is not supported by the new CR.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setAccessRoles', '!! Node::setAccessRoles() is not supported by the new CR.'); // getAccessRoles - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getAccessRoles', '!! Node::getAccessRoles() is not supported by the new CR.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getAccessRoles', '!! Node::getAccessRoles() is not supported by the new CR.'); // getPath $rectorConfig->rule(NodeGetPathRector::class); // Fusion: .depth -> Neos.NodeAccess.depth(node) @@ -146,16 +151,16 @@ // Fusion: .depth -> Neos.Node.depth(node) $rectorConfig->rule(FusionNodeDepthRector::class); // setWorkspace -> internal - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setWorkspace', '!! Node::setWorkspace() was always internal, and the workspace system has been fundamentally changed with the new CR. Try to rewrite your code around Content Streams.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setWorkspace', '!! Node::setWorkspace() was always internal, and the workspace system has been fundamentally changed with the new CR. Try to rewrite your code around Content Streams.'); // getWorkspace - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.'); // getIdentifier $rectorConfig->rule(NodeGetIdentifierRector::class); $rectorConfig->rule(FusionNodeIdentifierRector::class); // setIndex -> internal - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'setIndex', '!! Node::setIndex() was always internal. To reorder nodes, use the "MoveNodeAggregate" command'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'setIndex', '!! Node::setIndex() was always internal. To reorder nodes, use the "MoveNodeAggregate" command'); // getIndex - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getIndex', '!! Node::getIndex() is not supported. You can fetch all siblings and inspect the ordering'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getIndex', '!! Node::getIndex() is not supported. You can fetch all siblings and inspect the ordering'); // getParent -> Node $rectorConfig->rule(NodeGetParentRector::class); // Fusion: .parent -> Neos.NodeAccess.findParent(node) @@ -172,7 +177,7 @@ // remove() // setRemoved() // isRemoved() - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'isRemoved', '!! Node::isRemoved() - the new CR *never* returns removed nodes; so you can simplify your code and just assume removed == FALSE in all scenarios.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'isRemoved', '!! Node::isRemoved() - the new CR *never* returns removed nodes; so you can simplify your code and just assume removed == FALSE in all scenarios.'); $fusionNodePropertyPathToWarningComments[] = new FusionNodePropertyPathToWarningComment('removed', 'Line %LINE: !! node.removed - the new CR *never* returns removed nodes; so you can simplify your code and just assume removed == FALSE in all scenarios.'); // isVisible() // isAccessible() @@ -185,7 +190,7 @@ // copyAfter() // copyInto() // getNodeData() - $methodCallToWarningComments[] = new MethodCallToWarningComment(Node::class, 'getNodeData', '!! Node::getNodeData() - the new CR is not based around the concept of NodeData anymore. You need to rewrite your code here.'); + $methodCallToWarningComments[] = new MethodCallToWarningComment(NodeLegacyStub::class, 'getNodeData', '!! Node::getNodeData() - the new CR is not based around the concept of NodeData anymore. You need to rewrite your code here.'); // getContext() // getContext()->getWorkspace() $rectorConfig->rule(NodeGetContextGetWorkspaceRector::class); @@ -207,13 +212,13 @@ // isTethered() // getContentStreamIdentifier() -> threw exception in <= Neos 8.0 - so nobody could have used this // getNodeAggregateIdentifier() - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getNodeAggregateIdentifier', 'nodeAggregateId'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getNodeAggregateIdentifier', 'nodeAggregateId'); $rectorConfig->rule(rectorClass: FusionNodeAggregateIdentifierRector::class); // getNodeTypeName() - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getNodeTypeName', 'nodeTypeName'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getNodeTypeName', 'nodeTypeName'); // getNodeType() ** (included/compatible in old NodeInterface) // getNodeName() - $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(Node::class, 'getNodeName', 'nodeName'); + $methodCallToPropertyFetches[] = new MethodCallToPropertyFetch(NodeLegacyStub::class, 'getNodeName', 'nodeName'); // getOriginDimensionSpacePoint() -> threw exception in <= Neos 8.0 - so nobody could have used this // getProperties() ** (included/compatible in old NodeInterface) // getProperty() ** (included/compatible in old NodeInterface) @@ -285,13 +290,13 @@ // TODO: PHP // TODO: Fusion // ContentContext::isLive -> renderingMode.isLive - // TODO: PHP + $rectorConfig->rule(ContextIsLiveRector::class); $rectorConfig->rule(FusionContextLiveRector::class); // ContentContext::isInBackend -> renderingMode.inBackend - // TODO: PHP + $rectorConfig->rule(ContextIsInBackendRector::class); $rectorConfig->rule(FusionContextInBackendRector::class); // ContentContext::getCurrentRenderingMode... -> renderingMode... - // TODO: PHP + $rectorConfig->rule(ContextGetCurrentRenderingModeRector::class); $rectorConfig->rule(FusionContextCurrentRenderingModeRector::class); @@ -379,9 +384,14 @@ \Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds::class => 'toJson()', ]); + $rectorConfig->ruleWithConfiguration(RenameClassRector::class, [ + LegacyContextStub::class => NodeLegacyStub::class, + ]); + // Should run LAST - as other rules above might create $this->contentRepositoryRegistry calls. $rectorConfig->ruleWithConfiguration(InjectServiceIfNeededRector::class, [ new AddInjection('contentRepositoryRegistry', ContentRepositoryRegistry::class), + new AddInjection('renderingModeService', RenderingModeService::class), ]); // TODO: does not fully seem to work.$rectorConfig->rule(RemoveDuplicateCommentRector::class); }; diff --git a/src/ContentRepository90/Legacy/NodeLegacyStub.php b/src/ContentRepository90/Legacy/NodeLegacyStub.php new file mode 100644 index 0000000..820c658 --- /dev/null +++ b/src/ContentRepository90/Legacy/NodeLegacyStub.php @@ -0,0 +1,18 @@ +> + */ + public function getNodeTypes(): array + { + return [Node\Expr\MethodCall::class]; + } + + /** + * @param \PhpParser\Node\Stmt\Expression $node + */ + public function refactor(Node $node): ?Node + { + assert($node instanceof Node\Expr\MethodCall); + + $oldContextMethod = 'getCurrentRenderingMode'; + if ( + $this->isContextWithMethod($node, $oldContextMethod) + ) { + + return $this->nodeFactory->createMethodCall( + $this->nodeFactory->createPropertyFetch( + 'this', + 'renderingModeService' + ), + 'findByCurrentUser' + ); + } + + return null; + } + +} diff --git a/src/ContentRepository90/Rules/ContextIsInBackendRector.php b/src/ContentRepository90/Rules/ContextIsInBackendRector.php new file mode 100644 index 0000000..d22bfab --- /dev/null +++ b/src/ContentRepository90/Rules/ContextIsInBackendRector.php @@ -0,0 +1,67 @@ +> + */ + public function getNodeTypes(): array + { + return [Node\Expr\MethodCall::class]; + } + + /** + * @param \PhpParser\Node\Stmt\Expression $node + */ + public function refactor(Node $node): ?Node + { + assert($node instanceof Node\Expr\MethodCall); + + $oldContextMethod = 'isInBackend'; + if ($this->isContextWithMethod($node, $oldContextMethod)) { + + $renderingModeService = $this->nodeFactory->createMethodCall( + $this->nodeFactory->createPropertyFetch( + 'this', + 'renderingModeService' + ), + 'findByCurrentUser' + ); + + return $this->nodeFactory->createPropertyFetch( + $renderingModeService, 'isEdit' + ); + + } + + return null; + } + +} diff --git a/src/ContentRepository90/Rules/ContextIsLiveRector.php b/src/ContentRepository90/Rules/ContextIsLiveRector.php new file mode 100644 index 0000000..c587160 --- /dev/null +++ b/src/ContentRepository90/Rules/ContextIsLiveRector.php @@ -0,0 +1,80 @@ +> + */ + public function getNodeTypes(): array + { + return [Node\Expr\MethodCall::class]; + } + + /** + * @param \PhpParser\Node\Stmt\Expression $node + */ + public function refactor(Node $node): ?Node + { + assert($node instanceof Node\Expr\MethodCall); + + $oldContextMethod = 'isLive'; + if ($this->isContextWithMethod($node, $oldContextMethod)) { + + $renderingModeService = $this->nodeFactory->createMethodCall( + $this->nodeFactory->createPropertyFetch( + 'this', + 'renderingModeService' + ), + 'findByCurrentUser' + ); + + $isEdit = $this->nodeFactory->createPropertyFetch( + $renderingModeService, 'isEdit' + ); + $isPreview = $this->nodeFactory->createPropertyFetch( + $renderingModeService, 'isPreview' + ); + + $replacementExpression = new Node\Expr\BinaryOp\BooleanAnd( + new Node\Expr\BooleanNot( + $isEdit + ), + new Node\Expr\BooleanNot( + $isPreview + ), + ); + + return $replacementExpression; + } + + return null; + } + +} diff --git a/src/ContentRepository90/Rules/ContextRectorTrait.php b/src/ContentRepository90/Rules/ContextRectorTrait.php new file mode 100644 index 0000000..d14b509 --- /dev/null +++ b/src/ContentRepository90/Rules/ContextRectorTrait.php @@ -0,0 +1,27 @@ +name == $methodName + && $this->isObjectType($node->var, new ObjectType('Neos\Rector\ContentRepository90\Legacy\LegacyContextStub') + ) + ); + } +} diff --git a/src/ContentRepository90/Rules/NodeFindParentNodeRector.php b/src/ContentRepository90/Rules/NodeFindParentNodeRector.php index eb283dc..18c9deb 100644 --- a/src/ContentRepository90/Rules/NodeFindParentNodeRector.php +++ b/src/ContentRepository90/Rules/NodeFindParentNodeRector.php @@ -41,7 +41,7 @@ public function refactor(Node $node): ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'findParentNode')) { diff --git a/src/ContentRepository90/Rules/NodeGetChildNodesRector.php b/src/ContentRepository90/Rules/NodeGetChildNodesRector.php index cfd1029..eafa683 100644 --- a/src/ContentRepository90/Rules/NodeGetChildNodesRector.php +++ b/src/ContentRepository90/Rules/NodeGetChildNodesRector.php @@ -39,7 +39,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getChildNodes')) { diff --git a/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceNameRector.php b/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceNameRector.php index 08c25d2..defc1c8 100644 --- a/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceNameRector.php +++ b/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceNameRector.php @@ -51,7 +51,7 @@ public function refactor(Node $node): ?Node return null; } - if (!$this->isObjectType($node->var->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } diff --git a/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceRector.php b/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceRector.php index 486150c..a63c834 100644 --- a/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceRector.php +++ b/src/ContentRepository90/Rules/NodeGetContextGetWorkspaceRector.php @@ -51,7 +51,7 @@ public function refactor(Node $node): ?Node return null; } - if (!$this->isObjectType($node->var->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } diff --git a/src/ContentRepository90/Rules/NodeGetDepthRector.php b/src/ContentRepository90/Rules/NodeGetDepthRector.php index b278821..e232dc9 100644 --- a/src/ContentRepository90/Rules/NodeGetDepthRector.php +++ b/src/ContentRepository90/Rules/NodeGetDepthRector.php @@ -39,7 +39,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getDepth')) { diff --git a/src/ContentRepository90/Rules/NodeGetDimensionsRector.php b/src/ContentRepository90/Rules/NodeGetDimensionsRector.php index ded3438..88c9704 100644 --- a/src/ContentRepository90/Rules/NodeGetDimensionsRector.php +++ b/src/ContentRepository90/Rules/NodeGetDimensionsRector.php @@ -39,7 +39,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getDimensions')) { diff --git a/src/ContentRepository90/Rules/NodeGetIdentifierRector.php b/src/ContentRepository90/Rules/NodeGetIdentifierRector.php index bbe5599..e75b64b 100644 --- a/src/ContentRepository90/Rules/NodeGetIdentifierRector.php +++ b/src/ContentRepository90/Rules/NodeGetIdentifierRector.php @@ -40,7 +40,7 @@ public function refactor(Node $node): ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getIdentifier')) { diff --git a/src/ContentRepository90/Rules/NodeGetParentRector.php b/src/ContentRepository90/Rules/NodeGetParentRector.php index b2059fa..a05627e 100644 --- a/src/ContentRepository90/Rules/NodeGetParentRector.php +++ b/src/ContentRepository90/Rules/NodeGetParentRector.php @@ -39,7 +39,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getParent')) { diff --git a/src/ContentRepository90/Rules/NodeGetPathRector.php b/src/ContentRepository90/Rules/NodeGetPathRector.php index 9711e82..f5d69f8 100644 --- a/src/ContentRepository90/Rules/NodeGetPathRector.php +++ b/src/ContentRepository90/Rules/NodeGetPathRector.php @@ -39,7 +39,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'getPath')) { diff --git a/src/ContentRepository90/Rules/NodeIsHiddenInIndexRector.php b/src/ContentRepository90/Rules/NodeIsHiddenInIndexRector.php index 38ae4c0..96f618a 100644 --- a/src/ContentRepository90/Rules/NodeIsHiddenInIndexRector.php +++ b/src/ContentRepository90/Rules/NodeIsHiddenInIndexRector.php @@ -41,7 +41,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'isHiddenInIndex')) { diff --git a/src/ContentRepository90/Rules/NodeIsHiddenRector.php b/src/ContentRepository90/Rules/NodeIsHiddenRector.php index 3a4275f..6e35f89 100644 --- a/src/ContentRepository90/Rules/NodeIsHiddenRector.php +++ b/src/ContentRepository90/Rules/NodeIsHiddenRector.php @@ -41,7 +41,7 @@ public function refactor(Node $node) : ?Node { assert($node instanceof Node\Expr\MethodCall); - if (!$this->isObjectType($node->var, new ObjectType(\Neos\ContentRepository\Core\Projection\ContentGraph\Node::class))) { + if (!$this->isObjectType($node->var, new ObjectType(\Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub::class))) { return null; } if (!$this->isName($node->name, 'isHidden')) { diff --git a/src/Generic/Rules/MethodCallToWarningCommentRector.php b/src/Generic/Rules/MethodCallToWarningCommentRector.php index 222d2f3..25bf7aa 100644 --- a/src/Generic/Rules/MethodCallToWarningCommentRector.php +++ b/src/Generic/Rules/MethodCallToWarningCommentRector.php @@ -13,6 +13,7 @@ use Rector\PostRector\Collector\NodesToAddCollector; use Symplify\RuleDocGenerator\ValueObject\RuleDefinition; use Webmozart\Assert\Assert; +use Neos\Rector\ContentRepository90\Legacy\NodeLegacyStub; final class MethodCallToWarningCommentRector extends AbstractRector implements ConfigurableRectorInterface { @@ -32,7 +33,7 @@ public function __construct( public function getRuleDefinition(): RuleDefinition { return CodeSampleLoader::fromFile('"Warning comments for various non-supported use cases', __CLASS__, [ - new MethodCallToWarningComment(Node::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.') + new MethodCallToWarningComment(NodeLegacyStub::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.') ]); } diff --git a/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/ContextGetCurrentRenderingModeRectorTest.php b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/ContextGetCurrentRenderingModeRectorTest.php new file mode 100644 index 0000000..c0ff104 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/ContextGetCurrentRenderingModeRectorTest.php @@ -0,0 +1,31 @@ +doTestFile($fileInfo); + } + + /** + * @return \Iterator + */ + public function provideData(): \Iterator + { + return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class.php.inc new file mode 100644 index 0000000..1573352 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class.php.inc @@ -0,0 +1,25 @@ +getCurrentRenderingMode(); + } +} + +?> +----- +renderingModeService->findByCurrentUser(); + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class2.php.inc b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class2.php.inc new file mode 100644 index 0000000..fed3457 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class2.php.inc @@ -0,0 +1,27 @@ +getContext(); + $renderingMode = $context->getCurrentRenderingMode(); + } +} + +?> +----- +getContext(); + $renderingMode = $this->renderingModeService->findByCurrentUser(); + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class3.php.inc b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class3.php.inc new file mode 100644 index 0000000..49e6c99 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/Fixture/some_class3.php.inc @@ -0,0 +1,25 @@ +getContext()->getCurrentRenderingMode(); + } +} + +?> +----- +renderingModeService->findByCurrentUser(); + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/config/configured_rule.php b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/config/configured_rule.php new file mode 100644 index 0000000..df0a952 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextGetCurrentRenderingModeRector/config/configured_rule.php @@ -0,0 +1,16 @@ +rule(\Neos\Rector\ContentRepository90\Rules\ContextGetCurrentRenderingModeRector::class); + + $rectorConfig->ruleWithConfiguration(InjectServiceIfNeededRector::class, [ + new AddInjection('renderingModeService', RenderingModeService::class) + ]); +}; diff --git a/tests/ContentRepository90/Rules/ContextIsInBackendRector/ContextIsInBackendTest.php b/tests/ContentRepository90/Rules/ContextIsInBackendRector/ContextIsInBackendTest.php new file mode 100644 index 0000000..ae1386c --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsInBackendRector/ContextIsInBackendTest.php @@ -0,0 +1,31 @@ +doTestFile($fileInfo); + } + + /** + * @return \Iterator + */ + public function provideData(): \Iterator + { + return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class.php.inc new file mode 100644 index 0000000..757bcfa --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class.php.inc @@ -0,0 +1,31 @@ +isInBackend(); + if ($context->isInBackend() && $foo == 'bar') { + return true; + } + } +} + +?> +----- +renderingModeService->findByCurrentUser()->isEdit; + if ($this->renderingModeService->findByCurrentUser()->isEdit && $foo == 'bar') { + return true; + } + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class2.php.inc b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class2.php.inc new file mode 100644 index 0000000..eaad4d4 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class2.php.inc @@ -0,0 +1,27 @@ +getContext(); + $isInBackend = $context->isInBackend(); + } +} + +?> +----- +getContext(); + $isInBackend = $this->renderingModeService->findByCurrentUser()->isEdit; + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class3.php.inc b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class3.php.inc new file mode 100644 index 0000000..24ac5a9 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsInBackendRector/Fixture/some_class3.php.inc @@ -0,0 +1,33 @@ +getContext()->isInBackend() && $foo == 'bar') { + return true; + } + } +} + +?> +----- +renderingModeService->findByCurrentUser()->isEdit && $foo == 'bar') { + return true; + } + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsInBackendRector/config/configured_rule.php b/tests/ContentRepository90/Rules/ContextIsInBackendRector/config/configured_rule.php new file mode 100644 index 0000000..56732dc --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsInBackendRector/config/configured_rule.php @@ -0,0 +1,16 @@ +rule(\Neos\Rector\ContentRepository90\Rules\ContextIsInBackendRector::class); + + $rectorConfig->ruleWithConfiguration(InjectServiceIfNeededRector::class, [ + new AddInjection('renderingModeService', RenderingModeService::class) + ]); +}; diff --git a/tests/ContentRepository90/Rules/ContextIsLiveRector/ContextIsLiveTest.php b/tests/ContentRepository90/Rules/ContextIsLiveRector/ContextIsLiveTest.php new file mode 100644 index 0000000..8b3bbbe --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsLiveRector/ContextIsLiveTest.php @@ -0,0 +1,31 @@ +doTestFile($fileInfo); + } + + /** + * @return \Iterator + */ + public function provideData(): \Iterator + { + return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture'); + } + + public function provideConfigFilePath(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class.php.inc new file mode 100644 index 0000000..6f00b31 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class.php.inc @@ -0,0 +1,31 @@ +isLive(); + if ($context->isLive() && $foo == 'bar') { + return true; + } + } +} + +?> +----- +renderingModeService->findByCurrentUser()->isEdit && !$this->renderingModeService->findByCurrentUser()->isPreview; + if (!$this->renderingModeService->findByCurrentUser()->isEdit && !$this->renderingModeService->findByCurrentUser()->isPreview && $foo == 'bar') { + return true; + } + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class2.php.inc b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class2.php.inc new file mode 100644 index 0000000..bb23761 --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class2.php.inc @@ -0,0 +1,27 @@ +getContext(); + $isLive = $context->isLive(); + } +} + +?> +----- +getContext(); + $isLive = !$this->renderingModeService->findByCurrentUser()->isEdit && !$this->renderingModeService->findByCurrentUser()->isPreview; + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class3.php.inc b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class3.php.inc new file mode 100644 index 0000000..ac78aee --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsLiveRector/Fixture/some_class3.php.inc @@ -0,0 +1,33 @@ +getContext()->isLive() && $foo == 'bar') { + return true; + } + } +} + +?> +----- +renderingModeService->findByCurrentUser()->isEdit && !$this->renderingModeService->findByCurrentUser()->isPreview && $foo == 'bar') { + return true; + } + } +} + +?> diff --git a/tests/ContentRepository90/Rules/ContextIsLiveRector/config/configured_rule.php b/tests/ContentRepository90/Rules/ContextIsLiveRector/config/configured_rule.php new file mode 100644 index 0000000..c04481b --- /dev/null +++ b/tests/ContentRepository90/Rules/ContextIsLiveRector/config/configured_rule.php @@ -0,0 +1,16 @@ +rule(\Neos\Rector\ContentRepository90\Rules\ContextIsLiveRector::class); + + $rectorConfig->ruleWithConfiguration(InjectServiceIfNeededRector::class, [ + new AddInjection('renderingModeService', RenderingModeService::class) + ]); +}; diff --git a/tests/ContentRepository90/Rules/NodeFindParentNodeRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/NodeFindParentNodeRector/Fixture/some_class.php.inc index 40dd79d..23f4f45 100644 --- a/tests/ContentRepository90/Rules/NodeFindParentNodeRector/Fixture/some_class.php.inc +++ b/tests/ContentRepository90/Rules/NodeFindParentNodeRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ findParentNode(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); $parentNode = $subgraph->findParentNode($node->nodeAggregateId); diff --git a/tests/ContentRepository90/Rules/NodeGetDepthRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/NodeGetDepthRector/Fixture/some_class.php.inc index 0c1396b..9f86276 100644 --- a/tests/ContentRepository90/Rules/NodeGetDepthRector/Fixture/some_class.php.inc +++ b/tests/ContentRepository90/Rules/NodeGetDepthRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getDepth(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); return $subgraph->findNodePath($node->nodeAggregateId)->getDepth(); diff --git a/tests/ContentRepository90/Rules/NodeGetIdentifierRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/NodeGetIdentifierRector/Fixture/some_class.php.inc index 49720be..394c30f 100644 --- a/tests/ContentRepository90/Rules/NodeGetIdentifierRector/Fixture/some_class.php.inc +++ b/tests/ContentRepository90/Rules/NodeGetIdentifierRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getIdentifier(); } @@ -14,11 +14,11 @@ class SomeClass ----- getParent(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); return $subgraph->findParentNode($node->nodeAggregateId); diff --git a/tests/ContentRepository90/Rules/NodeIsHiddenInIndexRector/Fixture/some_class.php.inc b/tests/ContentRepository90/Rules/NodeIsHiddenInIndexRector/Fixture/some_class.php.inc index c1f4459..9806675 100644 --- a/tests/ContentRepository90/Rules/NodeIsHiddenInIndexRector/Fixture/some_class.php.inc +++ b/tests/ContentRepository90/Rules/NodeIsHiddenInIndexRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ isHiddenInIndex(); } @@ -14,11 +14,11 @@ class SomeClass ----- getProperty('_hiddenInIndex'); } diff --git a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/has_already_content_repository_registry.php.inc b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/has_already_content_repository_registry.php.inc index 3b22f18..815bb24 100644 --- a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/has_already_content_repository_registry.php.inc +++ b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/has_already_content_repository_registry.php.inc @@ -1,13 +1,13 @@ contentRepositoryRegistry->subgraphForNode($node); } @@ -17,14 +17,14 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); } diff --git a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_both.php.inc b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_both.php.inc index 1bac25c..c561c44 100644 --- a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_both.php.inc +++ b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_both.php.inc @@ -1,10 +1,10 @@ contentRepositoryRegistry->subgraphForNode($node); $currentRenderingMode = $this->renderingModeService->findByCurrentUser(); @@ -15,7 +15,7 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); $currentRenderingMode = $this->renderingModeService->findByCurrentUser(); diff --git a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_content_repository_registry.php.inc b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_content_repository_registry.php.inc index d0e544c..25bf258 100644 --- a/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_content_repository_registry.php.inc +++ b/tests/Generic/Rules/InjectServiceIfNeededRector/Fixture/needs_content_repository_registry.php.inc @@ -1,10 +1,10 @@ contentRepositoryRegistry->subgraphForNode($node); } @@ -14,13 +14,13 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); } diff --git a/tests/Rules/MethodCallToWarningCommentRector/Fixture/some_class.php.inc b/tests/Rules/MethodCallToWarningCommentRector/Fixture/some_class.php.inc index 8196f48..8718bab 100644 --- a/tests/Rules/MethodCallToWarningCommentRector/Fixture/some_class.php.inc +++ b/tests/Rules/MethodCallToWarningCommentRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getWorkspace(); } @@ -14,11 +14,11 @@ class SomeClass ----- ruleWithConfiguration(MethodCallToWarningCommentRector::class, [ - new MethodCallToWarningComment(Node::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.') + new MethodCallToWarningComment(NodeLegacyStub::class, 'getWorkspace', '!! Node::getWorkspace() does not make sense anymore concept-wise. In Neos < 9, it pointed to the workspace where the node was *at home at*. Now, the closest we have here is the node identity.') ]); }; diff --git a/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination-named-arguments.php.inc b/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination-named-arguments.php.inc index fd73667..59fa267 100644 --- a/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination-named-arguments.php.inc +++ b/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination-named-arguments.php.inc @@ -1,10 +1,10 @@ getChildNodes(offset: 100, limit: 10) as $node) { } @@ -15,11 +15,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. diff --git a/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination.php.inc b/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination.php.inc index dc78754..cae4318 100644 --- a/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination.php.inc +++ b/tests/Rules/NodeGetChildNodesRector/Fixture/all-with-pagination.php.inc @@ -1,10 +1,10 @@ getChildNodes(null, 10,100) as $node) { } @@ -15,11 +15,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. diff --git a/tests/Rules/NodeGetChildNodesRector/Fixture/all.php.inc b/tests/Rules/NodeGetChildNodesRector/Fixture/all.php.inc index 0471fcc..89db80b 100644 --- a/tests/Rules/NodeGetChildNodesRector/Fixture/all.php.inc +++ b/tests/Rules/NodeGetChildNodesRector/Fixture/all.php.inc @@ -1,10 +1,10 @@ getChildNodes() as $node) { } @@ -15,11 +15,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. diff --git a/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter-with-pagination.php.inc b/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter-with-pagination.php.inc index 5db707c..1668dbf 100644 --- a/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter-with-pagination.php.inc +++ b/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter-with-pagination.php.inc @@ -1,10 +1,10 @@ getChildNodes('Neos.Neos:Document', 10, 100) as $node) { } @@ -15,11 +15,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. diff --git a/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter.php.inc b/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter.php.inc index f2f5868..6f322d6 100644 --- a/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter.php.inc +++ b/tests/Rules/NodeGetChildNodesRector/Fixture/nodetype-filter.php.inc @@ -1,10 +1,10 @@ getChildNodes('Neos.Neos:Document') as $node) { } @@ -15,11 +15,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the iterator_to_array($nodes) call. diff --git a/tests/Rules/NodeGetContextGetWorkspaceNameRector/Fixture/some_class.php.inc b/tests/Rules/NodeGetContextGetWorkspaceNameRector/Fixture/some_class.php.inc index 06e335a..f246d9f 100644 --- a/tests/Rules/NodeGetContextGetWorkspaceNameRector/Fixture/some_class.php.inc +++ b/tests/Rules/NodeGetContextGetWorkspaceNameRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getContext()->getWorkspaceName(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId); return $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($node->subgraphIdentity->contentStreamId)->workspaceName; diff --git a/tests/Rules/NodeGetContextGetWorkspaceRector/Fixture/some_class.php.inc b/tests/Rules/NodeGetContextGetWorkspaceRector/Fixture/some_class.php.inc index 47b2614..c50a036 100644 --- a/tests/Rules/NodeGetContextGetWorkspaceRector/Fixture/some_class.php.inc +++ b/tests/Rules/NodeGetContextGetWorkspaceRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getContext()->getWorkspace(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId); return $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId($node->subgraphIdentity->contentStreamId); diff --git a/tests/Rules/NodeGetDimensionsRector/Fixture/some_class.php.inc b/tests/Rules/NodeGetDimensionsRector/Fixture/some_class.php.inc index 896692f..28ceab0 100644 --- a/tests/Rules/NodeGetDimensionsRector/Fixture/some_class.php.inc +++ b/tests/Rules/NodeGetDimensionsRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ getDimensions(); } @@ -14,11 +14,11 @@ class SomeClass ----- getPath(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->subgraphForNode($node); // TODO 9.0 migration: Try to remove the (string) cast and make your code more type-safe. diff --git a/tests/Rules/NodeIsHiddenRector/Fixture/some_class.php.inc b/tests/Rules/NodeIsHiddenRector/Fixture/some_class.php.inc index 21c3ccb..1c44129 100644 --- a/tests/Rules/NodeIsHiddenRector/Fixture/some_class.php.inc +++ b/tests/Rules/NodeIsHiddenRector/Fixture/some_class.php.inc @@ -1,10 +1,10 @@ isHidden(); } @@ -14,11 +14,11 @@ class SomeClass ----- contentRepositoryRegistry->get($node->subgraphIdentity->contentRepositoryId); $nodeHiddenStateFinder = $contentRepository->projectionState(\Neos\ContentRepository\Core\Projection\NodeHiddenState\NodeHiddenStateFinder::class);