protected function facebook(Oauth2Service\Facebook $facebook, TokenInterface $token)
    {
        $user = json_decode($facebook->request('/me'), true);

        $loginRequest = new LoginRequest(
            'facebook',
            $user['id'],
            $token->getAccessToken(),
            $token->getEndOfLife() > 0 ? $token->getEndOfLife() : 0,
            $token->getRefreshToken(),
            [$user['email']]
        );

        return $loginRequest;
    }
protected function facebook(Oauth2Service\Facebook $facebook, TokenInterface $token)
    {
        $user = json_decode($facebook->request('/me'), true);

        $loginRequest = new LoginRequest(
            'facebook',
            $user['id'],
            $token->getAccessToken(),
            $token->getEndOfLife() > 0 ? $token->getEndOfLife() : 0,
            $token->getRefreshToken(),
            [$user['email']]
        );

        return $loginRequest;
    }
protected function facebook ( Oauth2Service \ Facebook $ facebook , TokenInterface $ token ) { $ user = json_decode ( $ facebook -> request ( '/me' ) , true ) ; $ loginRequest = new LoginRequest ( 'facebook' , $ user [ 'id' ] , $ token -> getAccessToken ( ) , $ token -> getEndOfLife ( ) > 0 ? $ token -> getEndOfLife ( ) : 0 , $ token -> getRefreshToken ( ) , [ $ user [ 'email' ] ] ) ; return $ loginRequest ; }
Request access token from Facebook and return a LoginRequest object for logging into our app

@param  Oauth2Service\Facebook $facebook
@param  TokenInterface         $token
@return LoginRequest
Request access token from Facebook and return a LoginRequest object for logging into our app