From f5ab157cb5a0b3e38a920590df0c7b9e7055d060 Mon Sep 17 00:00:00 2001 From: GNIXNER Date: Thu, 14 Mar 2024 18:49:27 +0800 Subject: [PATCH] Update LocationRepository.php Access object properties using the object property access operator '->' fix: Cannot use object of type Stevebauman\Location\Position as array --- src/Repositories/LocationRepository.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Repositories/LocationRepository.php b/src/Repositories/LocationRepository.php index 49b9b0f..776c97d 100644 --- a/src/Repositories/LocationRepository.php +++ b/src/Repositories/LocationRepository.php @@ -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(); }