Completed
Push — master ( c98fe8...bf7ad8 )
by Joachim
05:52
created

CountryOfOrigin::getSource()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 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 30
    public function hydrateXml(\SimpleXMLElement $xml)
19
    {
20 30
        if (!isset($xml->CountryOfOrigin)) {
21 3
            return;
22
        }
23
24 27
        $this->country = (string)$xml->CountryOfOrigin->Country;
25 27
        $this->source = (string)$xml->CountryOfOrigin->Source;
26 27
    }
27
28
    /**
29
     * @return string
30
     */
31 9
    public function getCountry() : ?string
32
    {
33 9
        return $this->country;
34
    }
35
36
    /**
37
     * @return string
38
     */
39 9
    public function getSource() : ?string
40
    {
41 9
        return $this->source;
42
    }
43
}
44