Total Complexity | 6 |
Total Lines | 47 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | final class Point |
||
8 | { |
||
9 | private $pos; |
||
10 | |||
11 | private $lat; |
||
12 | |||
13 | private $lon; |
||
14 | |||
15 | /** |
||
16 | * Point constructor. |
||
17 | * @param $pos |
||
18 | */ |
||
19 | public function __construct($pos) |
||
20 | { |
||
21 | $this->pos = $pos; |
||
22 | if (!empty($pos)) { |
||
23 | $this->buildLatLon($pos); |
||
24 | } |
||
25 | } |
||
26 | |||
27 | private function buildLatLon($pos) |
||
28 | { |
||
29 | [$this->lon, $this->lat] = explode(' ', $pos); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function getPos() |
||
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return mixed |
||
42 | */ |
||
43 | public function getLat() |
||
44 | { |
||
45 | return $this->lat; |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function getLon() |
||
54 | } |
||
55 | |||
56 | |||
58 | } |