apiRequest('api/me'); $data = new Data\Collection($response); if (!$data->exists('result')) { throw new UnexpectedApiResponseException('Provider API returned an unexpected response.'); } $userProfile = new User\Profile(); $data = $data->filter('result'); $userProfile->identifier = $data->get('id'); $userProfile->description = $data->get('about'); $userProfile->photoURL = $data->get('profile_image'); $userProfile->webSiteURL = $data->get('website'); $userProfile->displayName = $data->get('name'); return $userProfile; } }