Completed
Push — master ( 7d5940...317e1d )
by Carsten
02:33
created

GeoDataAbstract   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 58
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 58
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getLatitude() 0 4 1
A getLongitude() 0 4 1
A getLatLon() 0 7 1
A getSource() 0 4 1
1
<?php
2
namespace Germania\GeoData;
3
4
abstract class GeoDataAbstract implements GeoDataInterface
5
{
6
7
8
    /**
9
     * @var float
10
     */
11
    public $latitude;
12
13
    /**
14
     * @var float
15
     */
16
    public $longitude;
17
18
    /**
19
     * @var string|null
20
     */
21
    public $source;
22
23
24
    /**
25
     * @inheritDoc
26
     */
27 6
    public function getLatitude() : ?float
28
    {
29 6
        return $this->latitude;
30
    }
31
32
    /**
33
     * @inheritDoc
34
     */
35 6
    public function getLongitude() : ?float
36
    {
37 6
        return $this->longitude;
38
    }
39
40
41
    /**
42
     * @inheritDoc
43
     */
44 6
    public function getLatLon() : array
45
    {
46
        return array(
47 6
            $this->getLatitude(),
48 6
            $this->getLongitude()
49
        );
50
    }
51
52
53
    /**
54
     * @inheritDoc
55
     */
56 2
    public function getSource() : ?string
57
    {
58 2
        return $this->source;
59
    }    
60
61
}
62