We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea1f472 commit 2e0c3aaCopy full SHA for 2e0c3aa
src/Dto/LocationDto.php
@@ -242,10 +242,13 @@ public function setMessage(string $message): LocationDto
242
*/
243
public static function fromArray(array $locationData): self
244
{
245
+ $lat = $locationData['lat'] ?? null;
246
+ $lon = $locationData['lon'] ?? null;
247
+
248
return new self(
249
$locationData['status'],
- (string)$locationData['lat'] ?? null,
- (string)$locationData['lon'] ?? null,
250
+ ($lat !== null) ? (string)$lat : $lat,
251
+ ($lon !== null) ? (string)$lon : $lon,
252
$locationData['timezone'] ?? null,
253
$locationData['region'] ?? null,
254
$locationData['country'] ?? null,
0 commit comments