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

GeoData   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 49
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A setLatitude() 0 5 1
A setLongitude() 0 5 1
A setSource() 0 5 1
A getGeoData() 0 4 1
1
<?php
2
namespace Germania\GeoData;
3
4
class GeoData extends GeoDataAbstract implements GeoDataInterface, GeoDataProviderInterface
5
{
6
7
8
    /**
9
     * @param float $latitude
10
     * @param float $longitude
11
     */
12 6
    public function __construct( ?float $latitude = null, ?float $longitude = null, ?string $source = null)
13
    {
14 6
        $this->setLatitude( $latitude );
15 6
        $this->setLongitude( $longitude );
16 6
        $this->setSource( $source );
17 6
    }
18
19
20 6
    public function setLatitude( ?float $latitude = null) : self
21
    {
22 6
        $this->latitude = $latitude;
23 6
        return $this;
24
    }
25
26
27 6
    public function setLongitude( ?float $longitude = null) : self
28
    {
29 6
        $this->longitude = $longitude;
30 6
        return $this;
31
    }
32
33
34 6
    public function setSource( ?string $source = null) : self
35
    {
36 6
        $this->source = $source;
37 6
        return $this;
38
    }
39
40
41
    /**
42
     * @inheritDoc
43
     * @return self
44
     */
45 4
    public function getGeoData() : ?GeoDataInterface
46
    {
47 4
        return $this;
48
    }
49
50
51
52
}
53