private function formatScheme(?string $scheme): ?string
    {
        if ('' === $scheme || null === $scheme) {
            return $scheme;
        }

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

        throw new SyntaxError(sprintf('The scheme `%s` is invalid', $scheme));
    }
private function formatScheme(?string $scheme): ?string
    {
        if ('' === $scheme || null === $scheme) {
            return $scheme;
        }

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

        throw new SyntaxError(sprintf('The scheme `%s` is invalid', $scheme));
    }
private function formatScheme ( ? string $ scheme ) : ? string { if ( '' === $ scheme || null === $ scheme ) { return $ scheme ; } $ formatted_scheme = strtolower ( $ scheme ) ; if ( 1 === preg_match ( self :: REGEXP_SCHEME , $ formatted_scheme ) ) { return $ formatted_scheme ; } throw new SyntaxError ( sprintf ( 'The scheme `%s` is invalid' , $ scheme ) ) ; }
Format the Scheme and Host component.

@param ?string $scheme

@throws SyntaxError if the scheme is invalid
Format the Scheme and Host component .