1 | <?php |
||
7 | final class GeoPoint implements ValueObjectInterface |
||
8 | { |
||
9 | /** |
||
10 | * @var float[] |
||
11 | */ |
||
12 | public const NULL_ISLAND = [ |
||
13 | "lon" => 0.0, |
||
14 | "lat" => 0.0 |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * @var Decimal |
||
19 | */ |
||
20 | private $lon; |
||
21 | |||
22 | /** |
||
23 | * @var Decimal |
||
24 | */ |
||
25 | private $lat; |
||
26 | |||
27 | /** |
||
28 | * @param float[] $point |
||
29 | * @return GeoPoint |
||
30 | */ |
||
31 | 22 | public static function fromArray(array $point): self |
|
37 | |||
38 | /** |
||
39 | * @param null|float[] $nativeValue |
||
40 | * @return GeoPoint |
||
41 | */ |
||
42 | 22 | public static function fromNative($nativeValue): self |
|
47 | |||
48 | /** |
||
49 | * @return float[] |
||
50 | */ |
||
51 | 7 | public function toNative(): array |
|
55 | |||
56 | 1 | public function equals(ValueObjectInterface $otherValue): bool |
|
60 | |||
61 | 1 | public function __toString(): string |
|
65 | |||
66 | public function isNullIsland(): bool |
||
70 | |||
71 | 1 | public function getLon(): Decimal |
|
75 | |||
76 | 1 | public function getLat(): Decimal |
|
80 | |||
81 | 22 | private function __construct(Decimal $lon, Decimal $lat) |
|
86 | } |
||
87 |