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

GeoDataAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A setGeoData() 0 10 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