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

GeoData::setSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

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