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:----glGMv2AL1MNSuff4SveEbXIKU4vzGGOPT54+XbnOMoRmzCDq/vvEPCqZ4deSu2TkkIJYiaIa9JHraDUm1TfxbjwJJo+UeGu5FI5eMWfRIr76mzzu3Sq38jQvMgpKwGXzp/90pxNP3hzIw1Nmpm8XXObxlD+Sn1Sui05qC7MkCucohmkLOGP6/3v8wUuHOgt5oubxU6zVbuOzBbt0fiy+ohhVZ7o+q+VyRJyS0fesQzdW9godug2CbiLx4KBgI7Zn+21MIphG5P/0eU2Fj7jJq+3XDWVetXdRUs6VoeQp2wMeUHNVzeWvkVdsxau6y2Y3aL8O1ADuA4XFNQrDid7yENgy8T6yrSL711G4GGwyZ0NB28BD/FL55oZCBKowFtTRECPr0XXi3tbcvwu4QUWAlwoin7YbP6uFAgD0mUxuJEiCWRXceOn4+K4zX48KLZ83J8r9y4AEfeePUMgzPQSPta7yEdt2DBsaqao6/ZvjAshf+IYBA0erGIkFa8meqgYa6eKX70Q/d6HQYsZ/SdlyqTq04PO9ndQR7QfJi2RGT6ixH2LF4QXOP7a4Q50iH/0uVywXM63aF9AdsLQ1Gv7+11h0IwKSTuNLhPCJbQa+epr79W+WExyC//wZzH0PYc6hJc0PSJG/BsjQ0Vh2jYZpkgkmzFbgUP+i12poZ8HXq1Y=----ATTACHMENT:----MzQ3OTczOTMwNzc0MDA0NCA5MDE1NDgwMjY3NDA3MjgwIDM4MjU0MjQzOTI0MDQxNzU=