Completed
Push — master ( e52a1e...5c6bea )
by Daniel
02:19
created

Location   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCountry() 0 4 1
A getLocation() 0 4 1
1
<?php
2
3
namespace Jobles\Core\Location;
4
5
use Phine\Country\CountryInterface;
6
7
class Location implements LocationInterface
8
{
9
    /**
10
     * @var CountryInterface
11
     */
12
    private $country;
13
14 19
    public function __construct(CountryInterface $country)
15
    {
16 19
        $this->country = $country;
17 19
    }
18
19
    /**
20
     * @return CountryInterface
21
     */
22 1
    public function getCountry()
23
    {
24 1
        return $this->country;
25
    }
26
27
    /* LocationInterface */
28
29
    /**
30
     * @return string
31
     */
32 1
    public function getLocation()
33
    {
34 1
        return $this->country->getAlpha2Code();
35
    }
36
}
37