public function parseProfileResponse(Response $response, AccessTokenInterface $access_token)
    {
        $profile = $response->json();

        if (gettype($profile) !== 'object') {
            throw new InvalidProfileException();
        }

        if (isset($profile->error)) {
            $error = $profile->error;

            throw new InvalidProfileException($error->type.': '.$error->message, $error->code);
        }

        $profile->access_token = $access_token->token();

        return $this->profile->instantiate($profile, $this->name);
    }
public function parseProfileResponse(Response $response, AccessTokenInterface $access_token)
    {
        $profile = $response->json();

        if (gettype($profile) !== 'object') {
            throw new InvalidProfileException();
        }

        if (isset($profile->error)) {
            $error = $profile->error;

            throw new InvalidProfileException($error->type.': '.$error->message, $error->code);
        }

        $profile->access_token = $access_token->token();

        return $this->profile->instantiate($profile, $this->name);
    }
public function parseProfileResponse ( Response $ response , AccessTokenInterface $ access_token ) { $ profile = $ response -> json ( ) ; if ( gettype ( $ profile ) !== 'object' ) { throw new InvalidProfileException ( ) ; } if ( isset ( $ profile -> error ) ) { $ error = $ profile -> error ; throw new InvalidProfileException ( $ error -> type . ': ' . $ error -> message , $ error -> code ) ; } $ profile -> access_token = $ access_token -> token ( ) ; return $ this -> profile -> instantiate ( $ profile , $ this -> name ) ; }
Parses a response coming from Facebook
containing a profile.

@param Vinelab\Http\Response                  $response
@param Vinelab\Contracts\AccessTokenInterface $access_token

@return Vinelab\Auth\Social\Profile
Parses a response coming from Facebook containing a profile .