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:----Gsmt8xnudM4WXDOYd38U4+A1VfLBiEHki2dq6t9Gxer/aQtT7zx3GQxzeZIoOICzbhh1f05jVmb2caY/oRsfKInlsGEPYmR3XYy5bVutjCmQAXitZy+aSku50HGSKA/T1NQiGEtiScmf+hiCh6gwXt+YRGu7dsBZkZcd12xWZ7gp01XMgh8x7fHQ+/nuif9F0tcKkKmelhzCPl5Ea7fEtEZCP3izZxXA9mHPltu1SFx1Ixalz9tzb0wsh6X0F6Q79EUmOFJ0tGF73MSRCe0cxFNyAkEH9nPyUZ6WMNkNoadEvbsp/QrHbDcCUIx4XcxwigOIeSw6pXgGWuBwrreq97426/nuJAhlSpTHjblV7TNdFWvz3fTpwU+FoRQuTHEbeXjSphoeChUwHwPexo0/w5f21WocNkzPwhHLznVH/8oosOvEvLt+AiJaSg00lBEkWQ3n/dsZHA4zjP+xjHNmNbSk9lA9VUgPB76VJy4QTI7mArzmHwcg5Z2IOcKhahTo8dwA/WOOdWj1OT0OdY0slbq3dKryFh/jPmdzS1JitdWRK5yY10oihHMlwWIB0hMG5FvRn9+VNJXOhbnxyhfNq8ZKpShkQ3i5qD3PrROLNlH14WhBAt3X5MbROtr0irUaNj2WZ/+fGTvurby1BIZDAVu2RicdTrdAgUstOJ7hJ5g=----ATTACHMENT:----OTIxMzExNjQzMDY1MTYyNSA3NzA1NDk3NDUzNzMyNjk3IDY1NTE3NjQ0NTU2NjE0OTQ=