Completed
Push — master ( af7add...6e606c )
by Karsten
02:11
created

Point   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 47
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fromLngLat() 0 9 1
A __construct() 0 3 1
A getLat() 0 4 1
A getLng() 0 4 1
1
<?php
2
/**
3
 * File was created 03.03.2016 13:39
4
 */
5
6
namespace PeekAndPoke\Component\GeoJson;
7
8
/**
9
 * @author Karsten J. Gerber <[email protected]>
10
 */
11
class Point
12
{
13
    public const TYPE = 'Point';
14
15
    /** @var float */
16
    private $lat;
17
    /** @var float */
18
    private $lng;
19
20
    /**
21
     * @param float $lng
22
     * @param float $lat
23
     *
24
     * @return Point
25
     */
26 2
    public static function fromLngLat($lng, $lat)
27
    {
28 2
        $ret = new self;
29
30 2
        $ret->lng = $lng;
31 2
        $ret->lat = $lat;
32
33 2
        return $ret;
34
    }
35
36
    /**
37
     */
38 2
    protected function __construct()
39
    {
40 2
    }
41
42
    /**
43
     * @return float
44
     */
45 1
    public function getLat()
46
    {
47 1
        return $this->lat;
48
    }
49
50
    /**
51
     * @return float
52
     */
53 1
    public function getLng()
54
    {
55 1
        return $this->lng;
56
    }
57
}
58