public function getGrant(string $grantType): GrantInterface
    {
        if ($this->hasGrant($grantType)) {
            return $this->grants[$grantType];
        }

        // If we reach here... then no grant was found. Not good!
        throw OAuth2Exception::unsupportedGrantType(sprintf(
            'Grant type "%s" is not supported by this server',
            $grantType
        ));
    }
public function getGrant(string $grantType): GrantInterface
    {
        if ($this->hasGrant($grantType)) {
            return $this->grants[$grantType];
        }

        // If we reach here... then no grant was found. Not good!
        throw OAuth2Exception::unsupportedGrantType(sprintf(
            'Grant type "%s" is not supported by this server',
            $grantType
        ));
    }
public function getGrant ( string $ grantType ) : GrantInterface { if ( $ this -> hasGrant ( $ grantType ) ) { return $ this -> grants [ $ grantType ] ; } // If we reach here... then no grant was found. Not good! throw OAuth2Exception :: unsupportedGrantType ( sprintf ( 'Grant type "%s" is not supported by this server' , $ grantType ) ) ; }
Get the grant by its name

@throws OAuth2Exception (unsupported_grant_type) When grant type is not registered
Get the grant by its name