Point   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 11
c 1
b 0
f 1
dl 0
loc 47
rs 10
wmc 6

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getPos() 0 3 1
A buildLatLon() 0 3 1
A getLon() 0 3 1
A __construct() 0 5 2
A getLat() 0 3 1
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
}