|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace WeDevBr\Bankly\Inputs; |
|
4
|
|
|
|
|
5
|
|
|
use WeDevBr\Bankly\Support\Contracts\CustomerAddressInterface; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* CustomerAddress class |
|
9
|
|
|
* |
|
10
|
|
|
* PHP version 7.4|8.0 |
|
11
|
|
|
* |
|
12
|
|
|
* @author WeDev Brasil Team <[email protected]> |
|
13
|
|
|
* @author Rafael Teixeira <[email protected]> |
|
14
|
|
|
* @copyright 2020 We Dev Tecnologia Ltda |
|
15
|
|
|
* @link https://github.com/wedevBr/bankly-laravel |
|
16
|
|
|
*/ |
|
17
|
|
|
class CustomerAddress implements CustomerAddressInterface |
|
18
|
|
|
{ |
|
19
|
|
|
/** @var string */ |
|
20
|
|
|
protected $zipCode; |
|
21
|
|
|
|
|
22
|
|
|
/** @var string */ |
|
23
|
|
|
protected $addressLine; |
|
24
|
|
|
|
|
25
|
|
|
/** @var string */ |
|
26
|
|
|
protected $buildingNumber; |
|
27
|
|
|
|
|
28
|
|
|
/** @var string */ |
|
29
|
|
|
protected $complement; |
|
30
|
|
|
|
|
31
|
|
|
/** @var string */ |
|
32
|
|
|
protected $neighborhood; |
|
33
|
|
|
|
|
34
|
|
|
/** @var string */ |
|
35
|
|
|
protected $city; |
|
36
|
|
|
|
|
37
|
|
|
/** @var string */ |
|
38
|
|
|
protected $state; |
|
39
|
|
|
|
|
40
|
|
|
/** @var string */ |
|
41
|
|
|
protected $country; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* @param string $zipCode |
|
45
|
|
|
* @return CustomerAddress |
|
46
|
|
|
*/ |
|
47
|
|
|
public function setZipCode(string $zipCode): CustomerAddress |
|
48
|
|
|
{ |
|
49
|
|
|
$this->zipCode = $zipCode; |
|
50
|
|
|
return $this; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
55
|
|
|
* @return CustomerAddress |
|
56
|
|
|
*/ |
|
57
|
|
|
public function setAddressLine(string $addressLine): CustomerAddress |
|
58
|
|
|
{ |
|
59
|
|
|
$this->addressLine = $addressLine; |
|
60
|
|
|
return $this; |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
65
|
|
|
* @return CustomerAddress |
|
66
|
|
|
*/ |
|
67
|
|
|
public function setBuildingNumber(string $buildingNumber): CustomerAddress |
|
68
|
|
|
{ |
|
69
|
|
|
$this->buildingNumber = $buildingNumber; |
|
70
|
|
|
return $this; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
/** |
|
74
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
75
|
|
|
* @return CustomerAddress |
|
76
|
|
|
*/ |
|
77
|
|
|
public function setComplement(string $complement): CustomerAddress |
|
78
|
|
|
{ |
|
79
|
|
|
$this->complement = $complement; |
|
80
|
|
|
return $this; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
/** |
|
84
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
85
|
|
|
* @return CustomerAddress |
|
86
|
|
|
*/ |
|
87
|
|
|
public function setNeighborhood(string $neighborhood): CustomerAddress |
|
88
|
|
|
{ |
|
89
|
|
|
$this->neighborhood = $neighborhood; |
|
90
|
|
|
return $this; |
|
91
|
|
|
} |
|
92
|
|
|
|
|
93
|
|
|
/** |
|
94
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
95
|
|
|
* @return CustomerAddress |
|
96
|
|
|
*/ |
|
97
|
|
|
public function setCity(string $city): CustomerAddress |
|
98
|
|
|
{ |
|
99
|
|
|
$this->city = $city; |
|
100
|
|
|
return $this; |
|
101
|
|
|
} |
|
102
|
|
|
|
|
103
|
|
|
/** |
|
104
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
105
|
|
|
* @return CustomerAddress |
|
106
|
|
|
*/ |
|
107
|
|
|
public function setState(string $state): CustomerAddress |
|
108
|
|
|
{ |
|
109
|
|
|
$this->state = $state; |
|
110
|
|
|
return $this; |
|
111
|
|
|
} |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* @param string $zipCode |
|
|
|
|
|
|
115
|
|
|
* @return CustomerAddress |
|
116
|
|
|
*/ |
|
117
|
|
|
public function setCountry(string $country): CustomerAddress |
|
118
|
|
|
{ |
|
119
|
|
|
$this->country = $country; |
|
120
|
|
|
return $this; |
|
121
|
|
|
} |
|
122
|
|
|
|
|
123
|
|
|
/** |
|
124
|
|
|
* @return string |
|
125
|
|
|
*/ |
|
126
|
|
|
public function getZipCode(): string |
|
127
|
|
|
{ |
|
128
|
|
|
return $this->zipCode; |
|
129
|
|
|
} |
|
130
|
|
|
|
|
131
|
|
|
/** |
|
132
|
|
|
* @return string |
|
133
|
|
|
*/ |
|
134
|
|
|
public function getAddressLine(): string |
|
135
|
|
|
{ |
|
136
|
|
|
return $this->addressLine; |
|
137
|
|
|
} |
|
138
|
|
|
|
|
139
|
|
|
/** |
|
140
|
|
|
* @return string |
|
141
|
|
|
*/ |
|
142
|
|
|
public function getBuildingNumber(): string |
|
143
|
|
|
{ |
|
144
|
|
|
return $this->buildingNumber; |
|
145
|
|
|
} |
|
146
|
|
|
|
|
147
|
|
|
/** |
|
148
|
|
|
* @return string |
|
149
|
|
|
*/ |
|
150
|
|
|
public function getComplement(): string |
|
151
|
|
|
{ |
|
152
|
|
|
return $this->complement; |
|
153
|
|
|
} |
|
154
|
|
|
|
|
155
|
|
|
/** |
|
156
|
|
|
* @return string |
|
157
|
|
|
*/ |
|
158
|
|
|
public function getNeighborhood(): string |
|
159
|
|
|
{ |
|
160
|
|
|
return $this->neighborhood; |
|
161
|
|
|
} |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* @return string |
|
165
|
|
|
*/ |
|
166
|
|
|
public function getCity(): string |
|
167
|
|
|
{ |
|
168
|
|
|
return $this->city; |
|
169
|
|
|
} |
|
170
|
|
|
|
|
171
|
|
|
/** |
|
172
|
|
|
* @return string |
|
173
|
|
|
*/ |
|
174
|
|
|
public function getState(): string |
|
175
|
|
|
{ |
|
176
|
|
|
return $this->state; |
|
177
|
|
|
} |
|
178
|
|
|
|
|
179
|
|
|
/** |
|
180
|
|
|
* @return string |
|
181
|
|
|
*/ |
|
182
|
|
|
public function getCountry(): string |
|
183
|
|
|
{ |
|
184
|
|
|
return $this->country; |
|
185
|
|
|
} |
|
186
|
|
|
|
|
187
|
|
|
/** |
|
188
|
|
|
* @return array |
|
189
|
|
|
*/ |
|
190
|
|
|
public function toArray(): array |
|
191
|
|
|
{ |
|
192
|
|
|
return [ |
|
193
|
|
|
'country' => $this->country, |
|
194
|
|
|
'state' => $this->state, |
|
195
|
|
|
'city' => $this->city, |
|
196
|
|
|
'neighborhood' => $this->neighborhood, |
|
197
|
|
|
'complement' => $this->complement, |
|
198
|
|
|
'buildingNumber' => $this->buildingNumber, |
|
199
|
|
|
'addressLine' => $this->addressLine, |
|
200
|
|
|
'zipCode' => $this->zipCode, |
|
201
|
|
|
]; |
|
202
|
|
|
} |
|
203
|
|
|
} |
|
204
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.