1 | <?php |
||
9 | class Address |
||
10 | { |
||
11 | /** |
||
12 | * City |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | private $city; |
||
17 | |||
18 | /** |
||
19 | * State |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private $state; |
||
24 | |||
25 | /** |
||
26 | * Postal Code - CEP |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $postalCode; |
||
31 | |||
32 | /** |
||
33 | * Address |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | private $address; |
||
38 | |||
39 | /** |
||
40 | * Address Number |
||
41 | * |
||
42 | * @var int |
||
43 | */ |
||
44 | private $number; |
||
45 | |||
46 | /** |
||
47 | * District |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $district; |
||
52 | |||
53 | /** |
||
54 | * Complement |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | private $complement; |
||
59 | |||
60 | /** |
||
61 | * Constructor |
||
62 | * |
||
63 | * @param string $city |
||
64 | * @param string $state |
||
65 | * @param string $postalCode |
||
66 | * @param string $address |
||
67 | * @param string $number |
||
68 | * @param string $district |
||
69 | * @param string $complement |
||
70 | */ |
||
71 | 17 | public function __construct( |
|
88 | |||
89 | /** |
||
90 | * Return the city |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | 1 | public function getCity(): string |
|
98 | |||
99 | /** |
||
100 | * Set the city |
||
101 | * |
||
102 | * @param string $city |
||
103 | */ |
||
104 | 2 | public function setCity(string $city) |
|
108 | |||
109 | /** |
||
110 | * Get the state |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | 1 | public function getState(): string |
|
118 | |||
119 | /** |
||
120 | * Set the state |
||
121 | * |
||
122 | * @param string $state |
||
123 | */ |
||
124 | 2 | public function setState(string $state) |
|
128 | |||
129 | /** |
||
130 | * Get the postal code |
||
131 | * |
||
132 | * @return string |
||
133 | */ |
||
134 | 1 | public function getPostalCode(): string |
|
138 | |||
139 | /** |
||
140 | * Set the postal code |
||
141 | * |
||
142 | * @param string $postalCode |
||
143 | */ |
||
144 | 1 | public function setPostalCode(string $postalCode) |
|
148 | |||
149 | /** |
||
150 | * @return the $address |
||
151 | */ |
||
152 | 1 | public function getAddress() |
|
156 | |||
157 | /** |
||
158 | * @param string $address |
||
159 | */ |
||
160 | 2 | public function setAddress(string $address) |
|
164 | |||
165 | /** |
||
166 | * @return the $number |
||
167 | */ |
||
168 | 1 | public function getNumber(): string |
|
172 | |||
173 | /** |
||
174 | * @param string $number |
||
175 | */ |
||
176 | 1 | public function setNumber(string $number) |
|
180 | |||
181 | /** |
||
182 | * @return the $district |
||
183 | */ |
||
184 | 1 | public function getDistrict(): string |
|
188 | |||
189 | /** |
||
190 | * @param string $district |
||
191 | */ |
||
192 | 1 | public function setDistrict(string $district) |
|
196 | |||
197 | /** |
||
198 | * @return the $complement |
||
199 | */ |
||
200 | 1 | public function getComplement(): string |
|
204 | |||
205 | /** |
||
206 | * @param string $complement |
||
207 | */ |
||
208 | 1 | public function setComplement(string $complement) |
|
212 | } |
||
213 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.