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

LocationWithState::getState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 4
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Jobles\Core\Location;
4
5
use Phine\Country\CountryInterface;
6
use Phine\Country\SubdivisionInterface;
7
8 View Code Duplication
class LocationWithState extends Location implements LocationInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10
    /**
11
     * @var SubdivisionInterface
12
     */
13
    private $state;
14
15 13
    public function __construct(CountryInterface $country, SubdivisionInterface $state)
16
    {
17 13
        parent::__construct($country);
18
19 13
        $this->state = $state;
20 13
    }
21
22
    /**
23
     * @return SubdivisionInterface
24
     */
25 1
    public function getState()
26
    {
27 1
        return $this->state;
28
    }
29
30
    /* LocationInterface */
31
32
    /**
33
     * @return string
34
     */
35 4
    public function getLocation()
36
    {
37 4
        return $this->state->getCode();
38
    }
39
}
40