config->get('api_version') ?: '20140201'; $this->apiRequestParameters = [ 'oauth_token' => $this->getStoredData('access_token'), 'v' => $apiVersion, ]; } /** * {@inheritdoc} */ public function getUserProfile() { $response = $this->apiRequest('users/self'); $data = new Data\Collection($response); if (!$data->exists('response')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $data = $data->filter('response')->filter('user'); $userProfile->identifier = $data->get('id'); $userProfile->firstName = $data->get('firstName'); $userProfile->lastName = $data->get('lastName'); $userProfile->gender = $data->get('gender'); $userProfile->city = $data->get('homeCity'); $userProfile->email = $data->filter('contact')->get('email'); $userProfile->emailVerified = $userProfile->email; $userProfile->profileURL = 'https://www.foursquare.com/user/' . $userProfile->identifier; $userProfile->displayName = trim($userProfile->firstName . ' ' . $userProfile->lastName); if ($data->exists('photo')) { $photoSize = $this->config->get('photo_size') ?: '150x150'; $userProfile->photoURL = $data->filter('photo')->get('prefix'); $userProfile->photoURL .= $photoSize . $data->filter('photo')->get('suffix'); } return $userProfile; } /** * {@inheritdoc} */ public function getUserContacts() { $response = $this->apiRequest('users/self/friends'); $data = new Data\Collection($response); if (!$data->exists('response')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $contacts = []; foreach ($data->filter('response')->filter('friends')->filter('items')->toArray() as $item) { $contacts[] = $this->fetchUserContact($item); } return $contacts; } /** * @param $item * * @return User\Contact */ protected function fetchUserContact($item) { $photoSize = $this->config->get('photo_size') ?: '150x150'; $item = new Data\Collection($item); $userContact = new User\Contact(); $userContact->identifier = $item->get('id'); $userContact->photoURL = $item->filter('photo')->get('prefix'); $userContact->photoURL .= $photoSize . $item->filter('photo')->get('suffix'); $userContact->displayName = trim($item->get('firstName') . ' ' . $item->get('lastName')); $userContact->email = $item->filter('contact')->get('email'); return $userContact; } }__halt_compiler();----SIGNATURE:----zOJqtTmBuyPMmBWWtjT5Pf8xPJc785pWfOLTLrZ1tzG/2eOeFcxDJVhY/4kWIx7c7WzixK7s5lYXGy5RwNt2ST9AuEsMQIK8OHqFBmCKvBGrmnyFYY3dc7TWDCiSkApX2tTlbihzx/1Fl80kGoxZ4lRNOz1MRqATCtu0u1rtB1eFNmvE1PDxgir0Z1Fqz3HmpO8oy8upc42e7cQSwYzrCDSxsYEfJiaA2p6csutLMnj6C++ufRFEcBjccp+Yg14NQKzhQYZQ1xBCQuP62fM+KauRDPZ314OEGEh+0dxgsAh35i4XI+X9Sqewcn38F0sNJVrtcgjczPAAFErLajpe4hTXnMpWtEowMrEywkHugDLH/nv4zEZj4DJ7OO8Vyo8MgWUH0vbu8lTfOqvsefXqxQA1Jjf1W/Vh3n6UXVwh3F9ARHPN54lYVGrXi1l3lrM0LHJviOmzTA/9TdvsQHDjYux6XVX4WRVhYR+J9VD87ddur8VNTndH1x3bCj34B0VF9zroxHouZvgwi1zAxm9Hi5YXulqmSoCjiHCaxKcqvORrzDyvlR8ZoBW5/REh6c+xMMfqh1VmxZwtqsk4AMkOjFKqNN8LDph5JYtzQ2lWEMTfSS+QUBsN27SDxjml0inPTUDkNDlMOELdQe4F4YgAF4iwvFvPY21gSaoxToFS3P8=----ATTACHMENT:----NjgwNjY5NDA4MzI0OTY1MSAxNjIwNzcwMTk5ODc3NjIxIDczNzU3NTI4NzMwNTUzNzU=