protected static function normalizeScheme(?string $scheme): string
    {
        if (!static::isValidScheme($scheme)) {
            $message = sprintf('Invalid URI scheme: %s', VarPrinter::toString($scheme));
            throw new DomainException($message);
        }

        return strtolower($scheme);
    }