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:----tLhzDoWOxs/uHWiIB/8HRzReSoCWlK4+zxkxIB6Uxcan1jqLt6pfRXZTmdqXcC1D6Pxpq3Fs2NmGxmYSMK2hBegKDc626k9SEGjcKwu4fQMxADRiVyML9ZEZJpg10Ftc+XPr5FXjOHebsnPWaCyArWu6qi2aEO0a5KTTMspGXPbvAZT+nDMmXQpWw8IhRIoXLTldcp0QOlw9ug21XVUpzm6AKUOe1P6rgjrCwXNcb9BlkKg/Ezjfne6KhOB2/pVYIcQBKOPajrSZa+k03fNph+OZxAZTpucMjlyvh0SihoMelEEsOxa3JH9YgMRzH605q8Ku0VW51ypdFetAw1kCoBw09GSFvrBrYxu9f11IchjkWZaeQvdnDKzvHyzAMLLghprVsTsm9QYOzyyj681JufF724LuPqHeAyBO2p9If0+o6t2BJWzq0kLxp3CzqsODyJ4vUzmQlQsbgQj8E4I0AQShj7VtQrNoShxM1vqpyB6RV/RVBqjLEmfg89NWiXF0R1Byg2kgrlfVuzoeE7+De9L3K9pavFyrd69xkv/dLaOrUpimy6QFJpr/GTah1K98c3oR7h1nBnZ7SB65XZHcbFH3TWECvUVpb/vqrlyybXu2avzst2LQMFL1wAdO55q5j5C29N9XqTLFnNVWvXPvc50EwOuZsBiZwRirH5JVVco=----ATTACHMENT:----NDYwMDk0NDE2OTIxMTU4MiA5NjkwOTM3OTg4NzQ0Mjc4IDUwOTUwODQ4NDU0NDMyNzY=