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

Point::fromLngLat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 2
crap 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