MAPG-10 add toArray to Position
This commit is contained in:
parent
037d19b0b3
commit
61cde2d40b
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user