private function validate($scheme): ?string
    {
        $scheme = $this->filterComponent($scheme);
        if (null === $scheme) {
            return $scheme;
        }

        if (1 === preg_match(self::REGEXP_SCHEME, $scheme)) {
            return strtolower($scheme);
        }

        throw new SyntaxError(sprintf("The scheme '%s' is invalid", $scheme));
    }