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

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

        if (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') {
            throw new CredentialsException('Error in retrieving temporary credentials.');
        }

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

        return $temporaryCredentials;
    }
protected function createTemporaryCredentials($body)
    {
        parse_str($body, $data);

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

        if (!isset($data['oauth_callback_confirmed']) || $data['oauth_callback_confirmed'] != 'true') {
            throw new CredentialsException('Error in retrieving temporary credentials.');
        }

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

        return $temporaryCredentials;
    }
protected function createTemporaryCredentials ( $ body ) { parse_str ( $ body , $ data ) ; if ( ! $ data || ! is_array ( $ data ) ) { throw new CredentialsException ( 'Unable to parse temporary credentials response.' ) ; } if ( ! isset ( $ data [ 'oauth_callback_confirmed' ] ) || $ data [ 'oauth_callback_confirmed' ] != 'true' ) { throw new CredentialsException ( 'Error in retrieving temporary credentials.' ) ; } $ temporaryCredentials = new TemporaryCredentials ( ) ; $ temporaryCredentials -> setIdentifier ( $ data [ 'oauth_token' ] ) ; $ temporaryCredentials -> setSecret ( $ data [ 'oauth_token_secret' ] ) ; return $ temporaryCredentials ; }
Creates temporary credentials from the body response.

@param string $body

@return TemporaryCredentials
Creates temporary credentials from the body response .