Completed
Push — master ( ad55a4...c98fe8 )
by Joachim
01:57
created

CountryOfOrigin   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 90%

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 38
ccs 9
cts 10
cp 0.9
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hydrateXml() 0 9 2
A getCountry() 0 4 1
A getSource() 0 4 1
1
<?php
2
namespace Loevgaard\AltaPay\Entity;
3
4
use Loevgaard\AltaPay\Hydrator\HydratableInterface;
5
6
class CountryOfOrigin implements HydratableInterface
7
{
8
    /**
9
     * @var string
10
     */
11
    private $country;
12
13
    /**
14
     * @var string
15
     */
16
    private $source;
17
18 9
    public function hydrateXml(\SimpleXMLElement $xml)
19
    {
20 9
        if(!isset($xml->CountryOfOrigin)) {
21
            return;
22
        }
23
24 9
        $this->country = (string)$xml->CountryOfOrigin->Country;
25 9
        $this->source = (string)$xml->CountryOfOrigin->Source;
26 9
    }
27
28
    /**
29
     * @return string
30
     */
31 3
    public function getCountry() : string
32
    {
33 3
        return $this->country;
34
    }
35
36
    /**
37
     * @return string
38
     */
39 3
    public function getSource() : string
40
    {
41 3
        return $this->source;
42
    }
43
}
44