src/Url.php
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;
    }
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;
    }
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 ; }
Parse scheme.

@param UrlInterface|null    $baseUrl      The base url or null if no base url is present.
@param string|null          $schemeString The scheme that is to be parsed or null if no scheme is present.
@param SchemeInterface|null $scheme       The scheme if parsing was successful, undefined otherwise.
@param string|null          $error        The error text if parsing was not successful, undefined otherwise.

@return bool True if parsing was successful, false otherwise.
Parse scheme .