src/Valkyrja/HttpMessage/NativeUri.php
protected function validatePath(string $path): string
    {
        if (strpos($path, '?') !== false) {
            throw new InvalidPath(
                'Invalid path provided; must not contain a query string'
            );
        }

        if (strpos($path, '#') !== false) {
            throw new InvalidPath(
                'Invalid path provided; must not contain a URI fragment'
            );
        }

        // TODO: Filter path

        return '/' . ltrim($path, '/');
    }
protected function validatePath(string $path): string
    {
        if (strpos($path, '?') !== false) {
            throw new InvalidPath(
                'Invalid path provided; must not contain a query string'
            );
        }

        if (strpos($path, '#') !== false) {
            throw new InvalidPath(
                'Invalid path provided; must not contain a URI fragment'
            );
        }

        // TODO: Filter path

        return '/' . ltrim($path, '/');
    }
Validate a path.

@param string $path The path

@throws \Valkyrja\HttpMessage\Exceptions\InvalidPath

@return string