public function getScheme(): string
    {
        if (!isset($this->segments['scheme'])) {
            throw new UrlException('Unable to get scheme for ' . $this->url);
        }

        return $this->segments['scheme'];
    }