diff --git a/config/set/contentrepository-90.php b/config/set/contentrepository-90.php index 56f8139..a613cf9 100644 --- a/config/set/contentrepository-90.php +++ b/config/set/contentrepository-90.php @@ -121,6 +121,7 @@ \Neos\ContentRepository\Domain\NodeType\NodeTypeName::class => \Neos\ContentRepository\Core\NodeType\NodeTypeName::class, \Neos\ContentRepository\Domain\Projection\Content\PropertyCollectionInterface::class => \Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection::class, \Neos\ContentRepository\Domain\Model\ArrayPropertyCollection::class => \Neos\ContentRepository\Core\Projection\ContentGraph\PropertyCollection::class, + \Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface::class => \Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface::class, ]); $rectorConfig->ruleWithConfiguration(FusionReplacePrototypeNameRector::class, [ diff --git a/src/ContentRepository90/Rules/YamlRoutePartHandlerRector.php b/src/ContentRepository90/Rules/YamlRoutePartHandlerRector.php index f5570cb..a7b33a0 100644 --- a/src/ContentRepository90/Rules/YamlRoutePartHandlerRector.php +++ b/src/ContentRepository90/Rules/YamlRoutePartHandlerRector.php @@ -32,9 +32,14 @@ public function refactorFileContent(string $fileContent): string continue; } + $handlerToReplace = [ + \Neos\Neos\Routing\FrontendNodeRoutePartHandler::class, + \Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface::class, + ]; + foreach ($routeConfig['routeParts'] as $routePartKey => $routePart) { - if (isset($routePart['handler']) && $routePart['handler'] === 'Neos\Neos\Routing\FrontendNodeRoutePartHandler') { - $parsed[$routeConfigKey]['routeParts'][$routePartKey]['handler'] = 'Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface'; + if (isset($routePart['handler']) && in_array($routePart['handler'], $handlerToReplace)) { + $parsed[$routeConfigKey]['routeParts'][$routePartKey]['handler'] = \Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface::class; } } } diff --git a/tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/SingleDimension1.yaml.inc b/tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/Routes.yaml.inc similarity index 93% rename from tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/SingleDimension1.yaml.inc rename to tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/Routes.yaml.inc index 4563a35..332bc17 100644 --- a/tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/SingleDimension1.yaml.inc +++ b/tests/ContentRepository90/Rules/YamlRoutePartHandlerRector/Fixture/Routes.yaml.inc @@ -46,7 +46,7 @@ uriPattern: '{node}' routeParts: node: - handler: Neos\Neos\Routing\FrontendNodeRoutePartHandlerInterface + handler: Neos\Neos\FrontendRouting\FrontendNodeRoutePartHandlerInterface options: uriPathSuffix: '' appendExceedingArguments: true diff --git a/tests/Sets/ContentRepository90/Fixture/frontend-node-route-part-handler.php.inc b/tests/Sets/ContentRepository90/Fixture/frontend-node-route-part-handler.php.inc new file mode 100644 index 0000000..b7ab91e --- /dev/null +++ b/tests/Sets/ContentRepository90/Fixture/frontend-node-route-part-handler.php.inc @@ -0,0 +1,23 @@ +