fkooman\OAuth\Client\AccessToken::setTokenType PHP Method

setTokenType() public method

public setTokenType ( $tokenType )
    public function setTokenType($tokenType)
    {
        if (!is_string($tokenType) || 0 >= strlen($tokenType)) {
            throw new TokenException('token_type needs to be a non-empty string');
        }
        // Google uses "Bearer" instead of "bearer", so we need to lowercase it...
        if (!in_array(strtolower($tokenType), array('bearer'))) {
            throw new TokenException(sprintf("unsupported token type '%s'", $tokenType));
        }
        $this->tokenType = $tokenType;
    }