Completed
Push — master ( c41446...eea56f )
by Carsten
02:52 queued 13s
created

GeoDataAwareTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 80%

Importance

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

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 GeoDataInterface
13
     * @return self
14
     */
15 4
    public function setGeoData( GeoDataProviderInterface $geodata ) : self
16
    {
17 4
        if ($geodata instanceOf GeoDataProviderInterface):
18 4
            $this->geodata = $geodata->getGeoData();
19
        else:
20
            $this->geodata = $geodata;
21
        endif;
22
23 4
        return $this;
24
    }
25
26
}
27