validateUserData($data); $this->userData = $data; return $this; } public function retrieveUserID() { return $this->userData['id']; } public function retrieveUserEmail() { return idx($this->userData, 'email'); } public function retrieveUserAccountName() { return $this->userData['login']; } public function retrieveUserProfileImage() { $id = $this->userData['gravatar_id']; if ($id) { $uri = 'http://www.gravatar.com/avatar/'.$id.'?s=50'; return @file_get_contents($uri); } return null; } public function retrieveUserAccountURI() { $username = $this->retrieveUserAccountName(); if ($username) { return 'https://github.com/'.$username; } return null; } public function retrieveUserRealName() { return idx($this->userData, 'name'); } public function shouldDiagnoseAppLogin() { return true; } }