Completed
Push — master ( 3ee5ff...5084e8 )
by Joachim
12:38
created

BillingAddress::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace Loevgaard\AltaPay\Response\Partial\Transaction\CustomerInfo;
3
4
use Loevgaard\AltaPay\Response\Partial\PartialResponse;
5
6
class BillingAddress extends PartialResponse
7
{
8
    /**
9
     * @var string
10
     */
11
    private $firstName;
12
13
    /**
14
     * @var string
15
     */
16
    private $lastName;
17
18
    /**
19
     * @var string
20
     */
21
    private $address;
22
23
    /**
24
     * @var string
25
     */
26
    private $city;
27
28
    /**
29
     * @var string
30
     */
31
    private $postalCode;
32
33
    /**
34
     * @var string
35
     */
36
    private $country;
37
38
    /**
39
     * @return string
40
     */
41
    public function getFirstName() : string
42
    {
43
        return $this->firstName;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getLastName() : string
50
    {
51
        return $this->lastName;
52
    }
53
54
    /**
55
     * @return string
56
     */
57
    public function getAddress() : string
58
    {
59
        return $this->address;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getCity() : string
66
    {
67
        return $this->city;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getPostalCode() : string
74
    {
75
        return $this->postalCode;
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getCountry() : string
82
    {
83
        return $this->country;
84
    }
85
86
    protected function init()
87
    {
88
        $this->firstName = (string)$this->xmlDoc->Firstname;
89
        $this->lastName = (string)$this->xmlDoc->Lastname;
90
        $this->address = (string)$this->xmlDoc->Address;
91
        $this->city = (string)$this->xmlDoc->City;
92
        $this->postalCode = (string)$this->xmlDoc->PostalCode;
93
        $this->country = (string)$this->xmlDoc->Country;
94
    }
95
}
96