Skip to content

Commit

Permalink
Update LocationRepository.php (#17)
Browse files Browse the repository at this point in the history
Access object properties using the object property access operator '->'

fix: Cannot use object of type Stevebauman\Location\Position as array
  • Loading branch information
gnixner committed Apr 9, 2024
1 parent 9cc3f78 commit 36d685a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Repositories/LocationRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ public static function getLocationFrom(string $ip): array
return LocationRepository::locationUnknown($ip);
}

$clickLocation['longitude'] = (float) $clickLocation['longitude'];
$clickLocation['latitude'] = (float) $clickLocation['latitude'];
$clickLocation->longitude = (float) $clickLocation->longitude;
$clickLocation->latitude = (float) $clickLocation->latitude;

unset($clickLocation['driver']);
unset($clickLocation->driver);

return $clickLocation->toArray();
}
Expand Down

0 comments on commit 36d685a

Please sign in to comment.