Total Complexity | 3 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | class LatLng extends AbstractObject |
||
23 | { |
||
24 | |||
25 | /** |
||
26 | * @var float |
||
27 | */ |
||
28 | protected $lat = 0; |
||
29 | |||
30 | /** |
||
31 | * @var float |
||
32 | */ |
||
33 | protected $lng = 0; |
||
34 | |||
35 | /** |
||
36 | * @var array |
||
37 | */ |
||
38 | protected $typeCheck = [ |
||
39 | LatLngFields::LAT => 'float', |
||
40 | LatLngFields::LNG => 'float', |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * @return string |
||
45 | */ |
||
46 | 5 | public function __toString(): string |
|
47 | { |
||
48 | |||
49 | 5 | return implode(',', [ |
|
50 | 5 | $this->getLat(), |
|
51 | 5 | $this->getLng() |
|
52 | ]); |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * Return the latitude, 0 if null |
||
57 | * |
||
58 | * @return string |
||
59 | */ |
||
60 | 9 | public function getLat(): string |
|
64 | } |
||
65 | |||
66 | /** |
||
67 | * Return the longitude, 0 if null |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | 9 | public function getLng(): string |
|
77 | } |