protected function createTokenCredentials($body)
    {
        parse_str($body, $data);

        if (!$data || !is_array($data)) {
            throw new CredentialsException('Unable to parse token credentials response.');
        }

        if (isset($data['error'])) {
            throw new CredentialsException("Error [{$data['error']}] in retrieving token credentials.");
        }

        $tokenCredentials = new TokenCredentials();
        $tokenCredentials->setIdentifier($data['oauth_token']);
        $tokenCredentials->setSecret($data['oauth_token_secret']);

        return $tokenCredentials;
    }
protected function createTokenCredentials($body)
    {
        parse_str($body, $data);

        if (!$data || !is_array($data)) {
            throw new CredentialsException('Unable to parse token credentials response.');
        }

        if (isset($data['error'])) {
            throw new CredentialsException("Error [{$data['error']}] in retrieving token credentials.");
        }

        $tokenCredentials = new TokenCredentials();
        $tokenCredentials->setIdentifier($data['oauth_token']);
        $tokenCredentials->setSecret($data['oauth_token_secret']);

        return $tokenCredentials;
    }
protected function createTokenCredentials ( $ body ) { parse_str ( $ body , $ data ) ; if ( ! $ data || ! is_array ( $ data ) ) { throw new CredentialsException ( 'Unable to parse token credentials response.' ) ; } if ( isset ( $ data [ 'error' ] ) ) { throw new CredentialsException ( "Error [{$data['error']}] in retrieving token credentials." ) ; } $ tokenCredentials = new TokenCredentials ( ) ; $ tokenCredentials -> setIdentifier ( $ data [ 'oauth_token' ] ) ; $ tokenCredentials -> setSecret ( $ data [ 'oauth_token_secret' ] ) ; return $ tokenCredentials ; }
Creates token credentials from the body response.

@param string $body

@return TokenCredentials
Creates token credentials from the body response .