Completed
Push — master ( df3255...b1b20b )
by Carsten
03:48
created

GeoDataAwareTrait::setGeoData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
rs 9.9332
cc 2
nc 2
nop 1
crap 2
1
<?php
2
namespace Germania\GeoData;
3
4
trait GeoDataAwareTrait
5
{
6
7
    use GeoDataProviderTrait;
8
9
10
11
    /**
12
     * @param null|GeoDataInterface
13
     * @return self
14
     */
15 6
    public function setGeoData( ?GeoDataProviderInterface $geodata ) : self
16
    {
17 6
        if ($geodata instanceOf GeoDataProviderInterface):
18 4
            $this->geodata = $geodata->getGeoData();
19
        else:
20 2
            $this->geodata = $geodata;
21
        endif;
22
23 6
        return $this;
24
    }
25
26
}
27