Skip to content

Commit

Permalink
Replace SimpleXMLElement by Data\Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
don-vip committed Mar 4, 2020
1 parent 54eafd0 commit 58cd921
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Provider/OpenStreetMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,15 @@ public function getUserProfile()
{
$response = $this->apiRequest('user/details');

$response = new \SimpleXMLElement($response);
$data = new Data\Collection($response);
$user = $data->get('user');

$userProfile = new User\Profile();

$userProfile->identifier = (string) $response->user['id'];
$userProfile->displayName = (string) $response->user['display_name'];
$userProfile->description = (string) $response->user->description;
$userProfile->photoURL = (string) $response->user->img['href'];
$userProfile->identifier = (string) $user['id'];
$userProfile->displayName = (string) $user['display_name'];
$userProfile->description = (string) $user->get('description');
$userProfile->photoURL = (string) $user->get('img')['href'];
$userProfile->profileURL = 'https://www.openstreetmap.org/user/' . $userProfile->displayName;

return $userProfile;
Expand Down

0 comments on commit 58cd921

Please sign in to comment.