MAPG-10 add toArray to Position

This commit is contained in:
Bence Pőcze 2020-05-19 03:14:20 +02:00
parent 037d19b0b3
commit 61cde2d40b

View File

@ -21,11 +21,16 @@ class Position
return $this->lng;
}
public function toJson(): string
public function toArray(): array
{
return json_encode([
return [
'lat' => $this->lat,
'lng' => $this->lng,
]);
];
}
public function toJson(): string
{
return json_encode($this->toArray());
}
}