public function setPath(string $path = null)
    {
        if ($path === null) {
            $uri = $this->server->get('REQUEST_URI');

            if (empty($uri)) {
                // Default to a slash
                $this->path = '/';
            } else {
                $uriParts = explode('?', $uri);
                $this->path = $uriParts[0];
            }
        } else {
            $this->path = $path;
        }
    }