isRefreshTokenAvailable()) { $this->tokenRefreshParameters += [ 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret ]; } } /** * {@inheritdoc} */ public function getUserProfile() { $response = $this->apiRequest('user'); $data = new Data\Collection($response); if (!$data->exists('id')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('id'); $userProfile->displayName = $data->get('name'); $userProfile->description = $data->get('bio'); $userProfile->photoURL = $data->get('avatar_url'); $userProfile->profileURL = $data->get('html_url'); $userProfile->email = $data->get('email'); $userProfile->webSiteURL = $data->get('blog'); $userProfile->region = $data->get('location'); $userProfile->displayName = $userProfile->displayName ?: $data->get('login'); if (empty($userProfile->email) && strpos($this->scope, 'user:email') !== false) { try { // user email is not mandatory so keep it quite. $userProfile = $this->requestUserEmail($userProfile); } catch (\Exception $e) { } } return $userProfile; } /** * Request connected user email * * https://developer.github.com/v3/users/emails/ * @param User\Profile $userProfile * * @return User\Profile * * @throws \Exception */ protected function requestUserEmail(User\Profile $userProfile) { $response = $this->apiRequest('user/emails'); foreach ($response as $idx => $item) { if (!empty($item->primary) && $item->primary == 1) { $userProfile->email = $item->email; if (!empty($item->verified) && $item->verified == 1) { $userProfile->emailVerified = $userProfile->email; } break; } } return $userProfile; } }__halt_compiler();----SIGNATURE:----Cn5aNN+UB7Y8lngugvyIcOcsMQzwjNH/2gNQl8Myki8cnKsvSEaCDbZvIrgTIvDH3f8oqzEiWe8Do72428MHFgbb6ENTawLtVYvTdABml8oihic72o9B2KuWkN40RG+n6fWkXI0q3EEKFlJSlCbL96tc4mOE1OA/2/KU/1BqoeVguAmtLm3EP1rYpDci+a1R7raezkFuJ7xJ1pbh1VXpvGhIdslNBp/Ou8+K+RfQFIPCre1yQYv0IaeNTMGz9KKugU1oZ4mJXb0jWWZxxo66pxcUy1hZ53GlCZvtWaI9m9q8iuoeiOUWgSuuoar4zo8n/YI808ceQy1AqhnO3k909Vugwa1YkGb3qljkFAPlVZh9gljFuL2/q7Ezv7F5Ml00u2N5Ot8bUt0t+G2yXO7oZvEzs+L6WGQkmxr9s8gIoNtfvJUsHSYnnKjGv6Q3vtPdI0Fz5kylpflbYzPcfXzXCYHQOSqfhdfTRVX7/aT0Ny3ohe6Re/z+HTbrMVm/EZ/NlxqiHVFjXbQUlPSufWYFWeiLmNKGRoxX/NsLK1uWw1JD55sLt/BQ34lhrQAw6XjceNva2qtX4Lbkx+Xm+fpMh6B4YsE7DfrAs+KtuH9dsNj/AtqIAgQguW8CRRaGu5m7vQMi6S3hx1UQDBYiiKB7osF2l0gsh+Ro44+v82rJSgI=----ATTACHMENT:----OTU5MzE0MzE2MzMwMDA0MSAxMzg5Mjc5Nzk1MDI4NjIzIDU0ODcxNjg0MTgyNzI4ODI=