Address::getAddressLines()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Genkgo\Camt\DTO;
6
7
class Address
8
{
9
    private ?string $country = null;
10
11
    private ?string $countrySubDivision = null;
12
13
    /**
14
     * @var string[]
15
     */
16
    private array $addressLines = [];
17
18
    private ?string $department = null;
19
20
    private ?string $subDepartment = null;
21
22
    private ?string $streetName = null;
23
24
    private ?string $buildingNumber = null;
25
26
    private ?string $postCode = null;
27
28
    private ?string $townName = null;
29
30
    public function getCountry(): ?string
31
    {
32
        return $this->country;
33
    }
34
35
    /**
36
     * @return static
37
     */
38
    public function setCountry(string $country): self
39
    {
40
        $cloned = clone $this;
41
        $cloned->country = $country;
42
43
        return $cloned;
44
    }
45
46
    public function getCountrySubDivision(): ?string
47
    {
48
        return $this->countrySubDivision;
49
    }
50
51
    /**
52
     * @return static
53
     */
54 6
    public function setCountrySubDivision(string $countrySubDivision): self
55
    {
56 6
        $cloned = clone $this;
57
        $cloned->countrySubDivision = $countrySubDivision;
58
59
        return $cloned;
60
    }
61
62 24
    /**
63
     * @return string[]
64 24
     */
65 24
    public function getAddressLines(): array
66
    {
67 24
        return $this->addressLines;
68
    }
69
70
    /**
71
     * @param string[] $addressLines
72
     *
73
     * @return static
74
     */
75
    public function setAddressLines(array $addressLines): self
76
    {
77
        $cloned = clone $this;
78
        $cloned->addressLines = $addressLines;
79
80
        return $cloned;
81
    }
82
83
    /**
84
     * @return static
85
     */
86
    public function addAddressLine(string $addressLine): self
87
    {
88
        $cloned = clone $this;
89 2
        $cloned->addressLines[] = $addressLine;
90
91 2
        return $cloned;
92
    }
93
94
    public function getDepartment(): ?string
95
    {
96
        return $this->department;
97
    }
98
99
    /**
100
     * @return static
101
     */
102
    public function setDepartment(string $department): self
103
    {
104
        $cloned = clone $this;
105
        $cloned->department = $department;
106
107
        return $cloned;
108
    }
109
110 17
    public function getSubDepartment(): ?string
111
    {
112 17
        return $this->subDepartment;
113 17
    }
114
115 17
    /**
116
     * @return static
117
     */
118
    public function setSubDepartment(string $subDepartment): self
119
    {
120
        $cloned = clone $this;
121
        $cloned->subDepartment = $subDepartment;
122
123
        return $cloned;
124
    }
125
126
    public function getStreetName(): ?string
127
    {
128
        return $this->streetName;
129
    }
130
131
    /**
132
     * @return static
133
     */
134
    public function setStreetName(string $streetName): self
135
    {
136
        $cloned = clone $this;
137
        $cloned->streetName = $streetName;
138
139
        return $cloned;
140
    }
141
142
    public function getBuildingNumber(): ?string
143
    {
144
        return $this->buildingNumber;
145
    }
146
147
    /**
148
     * @return static
149
     */
150 3
    public function setBuildingNumber(string $buildingNumber): self
151
    {
152 3
        $cloned = clone $this;
153
        $cloned->buildingNumber = $buildingNumber;
154
155
        return $cloned;
156
    }
157
158 23
    public function getPostCode(): ?string
159
    {
160 23
        return $this->postCode;
161 23
    }
162
163 23
    /**
164
     * @return static
165
     */
166
    public function setPostCode(string $postCode): self
167
    {
168
        $cloned = clone $this;
169
        $cloned->postCode = $postCode;
170
171
        return $cloned;
172
    }
173
174 7
    public function getTownName(): ?string
175
    {
176 7
        return $this->townName;
177 7
    }
178
179 7
    /**
180
     * @return static
181
     */
182
    public function setTownName(string $townName): self
183
    {
184
        $cloned = clone $this;
185
        $cloned->townName = $townName;
186
187
        return $cloned;
188
    }
189
}
190