Point::getPos()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace talismanfr\geocode\entity;
5
6
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()
36
    {
37
        return $this->pos;
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()
52
    {
53
        return $this->lon;
54
    }
55
56
57
58
}