src/Domain/Value/Identifier/Uri.php
protected static function normalizePath(string $path): string
    {
        if (!static::isValidPath($path)) {
            $message = sprintf('Invalid URI path: %s', $path);
            throw new DomainException($message);
        }

        $path = static::removeDotSegments($path);

        return static::encodePath(static::decode($path, static::UNRESERVED_SET));
    }
protected static function normalizePath(string $path): string
    {
        if (!static::isValidPath($path)) {
            $message = sprintf('Invalid URI path: %s', $path);
            throw new DomainException($message);
        }

        $path = static::removeDotSegments($path);

        return static::encodePath(static::decode($path, static::UNRESERVED_SET));
    }
protected static function normalizePath ( string $ path ) : string { if ( ! static :: isValidPath ( $ path ) ) { $ message = sprintf ( 'Invalid URI path: %s' , $ path ) ; throw new DomainException ( $ message ) ; } $ path = static :: removeDotSegments ( $ path ) ; return static :: encodePath ( static :: decode ( $ path , static :: UNRESERVED_SET ) ) ; }
Validates and normalizes the path

@param string $path The path

@return string

@throws DomainException When the path is invalid
Validates and normalizes the path