Neos\ContentRepository\Domain\Utility\NodePaths::normalizePath PHP Method

normalizePath() public static method

You should usually use \Neos\ContentRepository\Domain\Service\NodeService::normalizePath() because functionality could be overloaded, this is here only for low level operations.
See also: Neos\ContentRepository\Domain\Service\NodeService::normalizePath()
public static normalizePath ( $path, string $referencePath = null ) : string
$path
$referencePath string
return string
    public static function normalizePath($path, $referencePath = null)
    {
        if ($path === '.') {
            return $referencePath;
        }
        if (!is_string($path)) {
            throw new \InvalidArgumentException(sprintf('An invalid node path was specified: is of type %s but a string is expected.', gettype($path)), 1357832901);
        }
        if (strpos($path, '//') !== false) {
            throw new \InvalidArgumentException('Paths must not contain two consecutive slashes.', 1291371910);
        }
        if ($path[0] === '/') {
            $absolutePath = $path;
        } else {
            $absolutePath = NodePaths::addNodePathSegment($referencePath, $path);
        }
        $normalizedPath = NodePaths::replaceRelativePathElements($absolutePath);
        return strtolower($normalizedPath);
    }