private function resolveRelativeReference()
    {
        if (null !== $this->scheme) {
            $this->normalizeDotSegments();
        } else {
            $this->scheme = $this->baseUri->scheme;
            if (null !== $this->authority) {
                $this->normalizeDotSegments();
            } else {
                $this->authority = $this->baseUri->authority;
                $this->parseUserInfoHostPort();
                if ('' === $this->path) {
                    $this->path = $this->baseUri->path;
                    if (null === $this->query) {
                        $this->query = $this->baseUri->query;
                    }
                } else {
                    if (0 === strpos($this->path, '/')) {
                        $this->normalizeDotSegments();
                    } else {
                        $this->mergeBasePath();
                        $this->normalizeDotSegments();
                    }
                }
            }
        }
    }