1 | <?php |
||
9 | class Location implements Template |
||
10 | { |
||
11 | protected $latitude; |
||
12 | protected $longitude; |
||
13 | |||
14 | 1 | public function __construct(float $latitude, float $longitude) |
|
19 | |||
20 | /** |
||
21 | * Get latitude. |
||
22 | * |
||
23 | * @return float |
||
24 | */ |
||
25 | 1 | public function getLatitude(): float |
|
29 | |||
30 | /** |
||
31 | * Get longitude. |
||
32 | * |
||
33 | * @return float |
||
34 | */ |
||
35 | 1 | public function getLongitude(): float |
|
39 | |||
40 | /** |
||
41 | * Get the instance as an array. |
||
42 | * |
||
43 | * @return array |
||
44 | */ |
||
45 | 1 | public function toArray(): array |
|
52 | |||
53 | /** |
||
54 | * Specify data which should be serialized to JSON. |
||
55 | * @link http://php.net/manual/en/jsonserializable.jsonserialize.php |
||
56 | * @return mixed data which can be serialized by <b>json_encode</b>, |
||
57 | * which is a value of any type other than a resource. |
||
58 | * @since 5.4.0 |
||
59 | */ |
||
60 | 1 | public function jsonSerialize(): string |
|
64 | } |
||
65 |