protected function github(Oauth2Service\GitHub $github, TokenInterface $token)
    {
        $emails = json_decode($github->request('user/emails'), true);
        $user   = json_decode($github->request('user'), true);

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

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

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

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

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