src/Widop/Twitter/OAuth/OAuth.php
private function createBearerToken(OAuthResponse $response)
    {
        if (!$response->hasData('token_type') || !$response->hasData('access_token')) {
            throw new OAuthException('An error occured when creating the bearer token.', $response);
        }

        return new BearerToken($response->getData('access_token'));
    }
private function createBearerToken(OAuthResponse $response)
    {
        if (!$response->hasData('token_type') || !$response->hasData('access_token')) {
            throw new OAuthException('An error occured when creating the bearer token.', $response);
        }

        return new BearerToken($response->getData('access_token'));
    }
private function createBearerToken ( OAuthResponse $ response ) { if ( ! $ response -> hasData ( 'token_type' ) || ! $ response -> hasData ( 'access_token' ) ) { throw new OAuthException ( 'An error occured when creating the bearer token.' , $ response ) ; } return new BearerToken ( $ response -> getData ( 'access_token' ) ) ; }
Creates a bearer token according to an OAuth response.

@param \Widop\Twitter\OAuth\OAuthResponse $response The OAuth response.

@throws \Widop\Twitter\OAuth\OAuthException If the token cannot be created.

@return \Widop\Twitter\OAuth\Token\BearerToken The Bearer token.
Creates a bearer token according to an OAuth response .