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:----iIG6v6DqEfoVhe7ys/p7kHZBTu9Vn8KZ77XV07rIRWT1gNfwd/qTAZ4m4atTTpTrJDRh4wSqeaYFx2oc3N26cIiIOKKR8iuXzppWO9k8JQ6sDQ9vOwyTFbY8lDGXMpq0kr7XDI8DaUOhYa+wlqgkhH/mQb/oR/p9lv97gyelcAJo7qXfyZebEbewJQ0KIS+WRP0or0FXOdLrqLDyfid+fLOENuWHJTr91o73F1tExKF3oRXRdxpEVJS2eaVZscgWg/9RJpRXjFsvCWU9e36Cf9vrFPfvuJ2I0odsArkrcq+gwNpnmfWZhD3ic/zMBPVj0TpN8t1DnDgk5LGwmIOTQZRrqHeyiERSs3Vi4qA22tfDOkSAgcmNa6NbjqeCczb0fyEXBI8PkW2hC8oBdxjrxsj+Fmc0cdI9SQjGYVGShIj0OlW+id+quW3pKdfOHwCzZA9oKifDtGOJj6rJTj9RVUYJWESqmTxZ2XYpMlLV5UuLM7Aq6ioDxJOZUlqPkkteKHCY0yrH5nW6pWUwZYyMFEFtTdWjrC0v3G9nLFwIlU321aQRb9EZFhVzB+ATFQGSPsIDjjouo3VFvf8d3Ve0DZhdzuLHMOTym7ulM1Ma4kI3TkpXkcu6aD9nENAOeff/+19qvgqeuV0NVUHtPnyXMxHuUcJap6wZxM26E649YnE=----ATTACHMENT:----MTAxNTExMzYzMDk3NzI5IDk0NDkxMzgzMjM1MDg5MTcgODI1OTg1MDI0NDczNzcyMw==