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));
    }
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));
    }
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 ) ) ; }
Validate a scheme.

@throws SyntaxError if the scheme is invalid
Validate a scheme .