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() { $uri = idx($this->userData, 'avatar_url'); if ($uri) { 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; } }