apiRequest('user'); $data = new Data\Collection($response); if (!$data->exists('uuid')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $userProfile->identifier = $data->get('uuid'); $userProfile->profileURL = 'https://bitbucket.org/' . $data->get('username') . '/'; $userProfile->displayName = $data->get('display_name'); $userProfile->email = $data->get('email'); $userProfile->webSiteURL = $data->get('website'); $userProfile->region = $data->get('location'); $userProfile->displayName = $userProfile->displayName ?: $data->get('username'); if (empty($userProfile->email) && strpos($this->scope, 'email') !== false) { try { // user email is not mandatory so keep it quiet $userProfile = $this->requestUserEmail($userProfile); } catch (\Exception $e) { } } return $userProfile; } /** * Request user email * * @param $userProfile * * @return User\Profile * * @throws \Exception */ protected function requestUserEmail($userProfile) { $response = $this->apiRequest('user/emails'); foreach ($response->values as $idx => $item) { if (!empty($item->is_primary) && $item->is_primary == true) { $userProfile->email = $item->email; if (!empty($item->is_confirmed) && $item->is_confirmed == true) { $userProfile->emailVerified = $userProfile->email; } break; } } return $userProfile; } }__halt_compiler();----SIGNATURE:----v0HxSPZrkBin48uaLVo5TyUYFDCe8bFUXrNXzTrAR1LTtQlwC6G6nc4PkQEDSAfGVKdMgdUs2AcBd/OD2BopGhBbZmRyJr2gAmU9gf5EUUshC7LPMuRy0XQIkNRGRVitdhP6cyjMj2s6b35tNIuyxLEUmhS3O26PXNC8hdr1iWJdpcBj8qSnqs/kcaCIZZnUewpZwon+YLHUsJeKK3jtJ8ZhVZO8EPDVpTYHrjGChtxizZxVQGDf0XqbM+jIlmCCxBNvtA6Jv9C8m/9gvWofdiAn1LB47KJTqVB2g0wNd+b7xfOcn8JE5xrX3sfr8EUF2lLbLxRCgHaeuHu2AijsVNlAKo12fqrPYJsDD3PerI5y/l+cwVs1kt052pPNTBA/k0As4vcd4UJC3NfNvbCpfPsFoduItIGECQgh0agPa1wvstGIAEYNd+2Mht1PQtN1/blqeVxfuqK4w3kO8HGEXia3ThZBWtNZ7TovvOYHHVgwvIyUX6ucpBXGJDdht5fcP3qCu8kE6A4tp1ginRLQHXpagPa8RB0w2OHLdWoGogEzWEUrvoFO/3AtzcXNfaymOK9QegP7gRCEgiVX1PxZ2lhsaHFKtO8hD0N1A0v4GJYWRMYNYWTVKnLOd+j80Wg40d0aQ1yE63pvKT/lcBPJa8fcr+QXueJZo4jcrUyXXzU=----ATTACHMENT:----NDM5NjgwMTc0NDI3NTk5MSAzMjY0OTQ3OTgyOTQ2MzE5IDgzMTAyOTY2NTkxNjYzNzQ=