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:----WrS3gHATaIQ9Pjc6A19MFQiueFv4Kgxym08OJvUyvJnLrvu8XhwLF90nwAFvA2gVwA/ONy9xz+cVAS0u2jdSkp824d4Ts234Dbto5ysCTGuWjo4waU4ClvWwiKOaDVWsTgaKsPDzsX9aYeJ1Y24JcLhly1w7FnkZldMYu8JvLstJd/jBqI3OSqaT6DiddzVPv0HX/l20x+rbDmHf2qaSukcuELdIbJGm2eI31ASQocungCUroX+h25Y7x8umIZRtLRWqKcLAcw767aFED8pHGIksL2eaF9wyg9KgmX67cYOQz6yOKgxJaqd+MHTD2BxktjxtbHPs5+JrNXmlTP62Q2VUafWBKsnxKLpxHuRIHmfhr1LUkStr7Q1wd6JlKIazeeQTJHkWOfJPDecxA3mxP5vPjI6io4Yd1nS5pzrU38sRMiyFX7i/YDRhlMICZcfmJbwLhj2eZ5gRqgO8YUOrbGRJLWC8O1gP4A6jeYx+eGPDuyMlAMaPRW+wWaOAwh7r9ubSqntbHc8Wu4mVdi2OGCHdksuqNow/WjCwFit7QpsuX5WkjZcv9BSeGLf3tjdrbCmmg/JMjSOxNjytEunni7eEBUVtTv94P0whuutgtXZY6QblSDvKNnOrPg22CYvr4Lt9J7kPlx5IduxN9M14aQh9lDhzAqjMNdkvxz6YFCM=----ATTACHMENT:----MjkyMDkzMTEzNTI3MzExMSA4OTU0MjAxMzM5NzUyMzA3IDk2OTg1MDYwNDc5MjQ4MjM=