Skip to content

Commit

Permalink
TASK: Rename NodeAddressNormalizer to NodePathResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
mhsdesign committed Oct 14, 2024
1 parent 774d489 commit 418bc0e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
6 changes: 3 additions & 3 deletions Neos.Neos/Classes/Fusion/NodeUriImplementation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
use Neos\Neos\FrontendRouting\Options;
use Neos\Neos\Utility\LegacyNodePathNormalizer;
use Neos\Neos\Utility\NodeAddressNormalizer;
use Neos\Neos\Utility\NodePathResolver;
use Psr\Log\LoggerInterface;

/**
Expand Down Expand Up @@ -72,7 +72,7 @@ class NodeUriImplementation extends AbstractFusionObject

/**
* @Flow\Inject
* @var NodeAddressNormalizer
* @var NodePathResolver
*/
protected $nodeAddressNormalizer;

Expand Down Expand Up @@ -152,7 +152,7 @@ public function evaluate()
}

$possibleAbsoluteNodePath = $this->legacyNodePathNormalizer->tryResolveLegacyPathSyntaxToAbsoluteNodePath($node, $baseNode);
$nodeAddress = $this->nodeAddressNormalizer->resolveNodeAddressFromPath(
$nodeAddress = $this->nodeAddressNormalizer->resolveNodeAddressByPath(
$possibleAbsoluteNodePath ?? $node,
$baseNode
);
Expand Down
10 changes: 5 additions & 5 deletions Neos.Neos/Classes/Service/LinkingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
use Neos\Neos\FrontendRouting\NodeUriBuilder;
use Neos\Neos\Fusion\Helper\LinkHelper;
use Neos\Neos\Utility\LegacyNodePathNormalizer;
use Neos\Neos\Utility\NodeAddressNormalizer;
use Neos\Neos\Utility\NodePathResolver;
use Neos\Utility\Arrays;
use Psr\Http\Message\UriInterface;
use Psr\Log\LoggerInterface;
Expand Down Expand Up @@ -60,7 +60,7 @@
* ``~/about/us`` results in ``/sites/acmecom/about/us``,
* ``~`` results in ``/sites/acmecom``.
*
* @deprecated with Neos 9. Please use the new {@see NodeUriBuilder} instead and for resolving a relative node path {@see NodeAddressNormalizer::resolveNodeAddressFromPath()} or utilize the {@see LinkHelper} from Fusion
* @deprecated with Neos 9. Please use the new {@see NodeUriBuilder} instead and for resolving a relative node path {@see NodePathResolver::resolveNodeAddressByPath()} or utilize the {@see LinkHelper} from Fusion
* @Flow\Scope("singleton")
*/
class LinkingService
Expand All @@ -87,9 +87,9 @@ class LinkingService

/**
* @Flow\Inject
* @var NodeAddressNormalizer
* @var NodePathResolver
*/
protected $nodeAddressNormalizer;
protected $nodePathResolver;

/**
* @Flow\Inject
Expand Down Expand Up @@ -250,7 +250,7 @@ public function createNodeUri(
}

$possibleAbsoluteNodePath = $this->legacyNodePathNormalizer->tryResolveLegacyPathSyntaxToAbsoluteNodePath($node, $baseNode);
$nodeAddress = $this->nodeAddressNormalizer->resolveNodeAddressFromPath(
$nodeAddress = $this->nodePathResolver->resolveNodeAddressByPath(
$possibleAbsoluteNodePath ?? $node,
$baseNode
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Flow\Annotations as Flow;

final class NodeAddressNormalizer
/**
* @internal implementation detail of Neos.Neos:NodeUri
*/
final class NodePathResolver
{
#[Flow\Inject]
protected ContentRepositoryRegistry $contentRepositoryRegistry;
Expand All @@ -36,7 +39,7 @@ final class NodeAddressNormalizer
*
* For handling partially legacy paths please preprocess the path using {@see LegacyNodePathNormalizer::tryResolveLegacyPathSyntaxToAbsoluteNodePath()}
*/
public function resolveNodeAddressFromPath(AbsoluteNodePath|NodePath|string $path, Node $baseNode): NodeAddress
public function resolveNodeAddressByPath(AbsoluteNodePath|NodePath|string $path, Node $baseNode): NodeAddress
{
if ($path === '') {
throw new \RuntimeException('Empty strings can not be resolved to nodes.', 1719999872);
Expand Down
8 changes: 4 additions & 4 deletions Neos.Neos/Classes/ViewHelpers/Link/NodeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
use Neos\Neos\FrontendRouting\Options;
use Neos\Neos\Utility\LegacyNodePathNormalizer;
use Neos\Neos\Utility\NodeAddressNormalizer;
use Neos\Neos\Utility\NodePathResolver;
use Neos\Neos\Utility\NodeTypeWithFallbackProvider;

/**
Expand Down Expand Up @@ -143,9 +143,9 @@ class NodeViewHelper extends AbstractTagBasedViewHelper

/**
* @Flow\Inject
* @var NodeAddressNormalizer
* @var NodePathResolver
*/
protected $nodeAddressNormalizer;
protected $nodePathResolver;

/**
* @Flow\Inject
Expand Down Expand Up @@ -263,7 +263,7 @@ public function render(): string
);
} else {
$possibleAbsoluteNodePath = $this->legacyNodePathNormalizer->tryResolveLegacyPathSyntaxToAbsoluteNodePath($node, $baseNode);
$nodeAddress = $this->nodeAddressNormalizer->resolveNodeAddressFromPath(
$nodeAddress = $this->nodePathResolver->resolveNodeAddressByPath(
$possibleAbsoluteNodePath ?? $node,
$baseNode
);
Expand Down
8 changes: 4 additions & 4 deletions Neos.Neos/Classes/ViewHelpers/Uri/NodeViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
use Neos\Neos\FrontendRouting\NodeUriBuilderFactory;
use Neos\Neos\FrontendRouting\Options;
use Neos\Neos\Utility\LegacyNodePathNormalizer;
use Neos\Neos\Utility\NodeAddressNormalizer;
use Neos\Neos\Utility\NodePathResolver;

/**
* A view helper for creating URIs pointing to nodes.
Expand Down Expand Up @@ -119,9 +119,9 @@ class NodeViewHelper extends AbstractViewHelper

/**
* @Flow\Inject
* @var NodeAddressNormalizer
* @var NodePathResolver
*/
protected $nodeAddressNormalizer;
protected $nodePathResolver;

/**
* @Flow\Inject
Expand Down Expand Up @@ -207,7 +207,7 @@ public function render(): string
);
} else {
$possibleAbsoluteNodePath = $this->legacyNodePathNormalizer->tryResolveLegacyPathSyntaxToAbsoluteNodePath($node, $baseNode);
$nodeAddress = $this->nodeAddressNormalizer->resolveNodeAddressFromPath(
$nodeAddress = $this->nodePathResolver->resolveNodeAddressByPath(
$possibleAbsoluteNodePath ?? $node,
$baseNode
);
Expand Down

0 comments on commit 418bc0e

Please sign in to comment.