private static function myParseScheme(?UrlInterface $baseUrl = null, ?string $schemeString, ?SchemeInterface &$scheme = null, ?string &$error = null): bool
    {
        if ($schemeString === null) {
            if ($baseUrl === null) {
                $error = 'Scheme is missing.';

                return false;
            }

            $scheme = $baseUrl->getScheme();

            return true;
        }

        try {
            $scheme = Scheme::parse($schemeString);
        } catch (SchemeInvalidArgumentException $e) {
            $error = $e->getMessage();

            return false;
        }

        return true;
    }