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:----AN34tW8dYdbtf2ihb0vIpMtxz4vTn07niw9v/UhWS00clxC/LhuzQAJe4BIPBV2NWvg6Qw/HNNJjyQ4M693vI2IyUqUb8OFyGtSYx1D9E1rOSEI3+TBuhRNx/E4liFogkXQAZsXaWSQt2mVgJx86dsrimmpb+Tk2ihjtw+GLDOUKqHIwgZp4RZo6JOjfb7Hrumg4HUig2eWbwFnBXFmGiQp5kG3sdinNfEoJ1s2EruJOQn/6U3oJvXqEaXIKXXyGbYcgsMKXO5ttdfHcpxth9GuNoCEyziJ6Dmiane9tGhUIxR1in0jfC2z1FPnlNK6TgOd2HUp0ebtBbBg/lTsRK4MUyOlAsmSZY06nwA9OS9+O3PStLHQCz47G0AKntBnC/1CcUTzW73jMWa6scCyUn5q6U6uWcWMt9VQvuJjdsMdQlx/eotz0LFkv4E+0XvzpIxK/fHA+CUXDw82l6wOKNU90vlRl5PV7KieoTzEI3KelBfIgVO/rFAI1CRjbavGg5zxY9dfftyrsmHP6q0MEXNZJbzt5ghuZx3XDGjqrCdOmIkPYHGPWkReaBvuDmhuTl7pxN4YJMajMmHrxT+zFdEqUoDQ+nRPMGjI6n0Aby0vdSph8aHREw04IUktgSABb6G8iZwd0J5w6yTyYJj415NbK6D/iVQaYmH4RwZ3bBn4=----ATTACHMENT:----NDU5MzQyMzQzNzk1MDQ3MyA1MzA1MjIxMzQyMzMxNTMwIDg2MDEzMzQ3NTExNDYyMTA=