Total Complexity | 61 |
Total Lines | 488 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like NicUpdateIT often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use NicUpdateIT, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
12 | class NicUpdateIT extends AbstractStructBase |
||
13 | { |
||
14 | /** |
||
15 | * The session |
||
16 | * Meta information extracted from the WSDL |
||
17 | * - nillable: true |
||
18 | * @var string |
||
19 | */ |
||
20 | public $session; |
||
21 | /** |
||
22 | * The nic |
||
23 | * Meta information extracted from the WSDL |
||
24 | * - nillable: true |
||
25 | * @var string |
||
26 | */ |
||
27 | public $nic; |
||
28 | /** |
||
29 | * The name |
||
30 | * Meta information extracted from the WSDL |
||
31 | * - nillable: true |
||
32 | * @var string |
||
33 | */ |
||
34 | public $name; |
||
35 | /** |
||
36 | * The firstname |
||
37 | * Meta information extracted from the WSDL |
||
38 | * - nillable: true |
||
39 | * @var string |
||
40 | */ |
||
41 | public $firstname; |
||
42 | /** |
||
43 | * The sex |
||
44 | * Meta information extracted from the WSDL |
||
45 | * - nillable: true |
||
46 | * @var string |
||
47 | */ |
||
48 | public $sex; |
||
49 | /** |
||
50 | * The legalForm |
||
51 | * Meta information extracted from the WSDL |
||
52 | * - nillable: true |
||
53 | * @var string |
||
54 | */ |
||
55 | public $legalForm; |
||
56 | /** |
||
57 | * The organisation |
||
58 | * Meta information extracted from the WSDL |
||
59 | * - nillable: true |
||
60 | * @var string |
||
61 | */ |
||
62 | public $organisation; |
||
63 | /** |
||
64 | * The legalName |
||
65 | * Meta information extracted from the WSDL |
||
66 | * - nillable: true |
||
67 | * @var string |
||
68 | */ |
||
69 | public $legalName; |
||
70 | /** |
||
71 | * The legalNumber |
||
72 | * Meta information extracted from the WSDL |
||
73 | * - nillable: true |
||
74 | * @var string |
||
75 | */ |
||
76 | public $legalNumber; |
||
77 | /** |
||
78 | * The vat |
||
79 | * Meta information extracted from the WSDL |
||
80 | * - nillable: true |
||
81 | * @var string |
||
82 | */ |
||
83 | public $vat; |
||
84 | /** |
||
85 | * The birthDay |
||
86 | * Meta information extracted from the WSDL |
||
87 | * - nillable: true |
||
88 | * @var string |
||
89 | */ |
||
90 | public $birthDay; |
||
91 | /** |
||
92 | * The birthCity |
||
93 | * Meta information extracted from the WSDL |
||
94 | * - nillable: true |
||
95 | * @var string |
||
96 | */ |
||
97 | public $birthCity; |
||
98 | /** |
||
99 | * The nationalIdentificationNumber |
||
100 | * Meta information extracted from the WSDL |
||
101 | * - nillable: true |
||
102 | * @var string |
||
103 | */ |
||
104 | public $nationalIdentificationNumber; |
||
105 | /** |
||
106 | * The companyNationalIdentificationNumber |
||
107 | * Meta information extracted from the WSDL |
||
108 | * - nillable: true |
||
109 | * @var string |
||
110 | */ |
||
111 | public $companyNationalIdentificationNumber; |
||
112 | /** |
||
113 | * The corporationType |
||
114 | * Meta information extracted from the WSDL |
||
115 | * - nillable: true |
||
116 | * @var string |
||
117 | */ |
||
118 | public $corporationType; |
||
119 | /** |
||
120 | * Constructor method for nicUpdateIT |
||
121 | * @uses NicUpdateIT::setSession() |
||
122 | * @uses NicUpdateIT::setNic() |
||
123 | * @uses NicUpdateIT::setName() |
||
124 | * @uses NicUpdateIT::setFirstname() |
||
125 | * @uses NicUpdateIT::setSex() |
||
126 | * @uses NicUpdateIT::setLegalForm() |
||
127 | * @uses NicUpdateIT::setOrganisation() |
||
128 | * @uses NicUpdateIT::setLegalName() |
||
129 | * @uses NicUpdateIT::setLegalNumber() |
||
130 | * @uses NicUpdateIT::setVat() |
||
131 | * @uses NicUpdateIT::setBirthDay() |
||
132 | * @uses NicUpdateIT::setBirthCity() |
||
133 | * @uses NicUpdateIT::setNationalIdentificationNumber() |
||
134 | * @uses NicUpdateIT::setCompanyNationalIdentificationNumber() |
||
135 | * @uses NicUpdateIT::setCorporationType() |
||
136 | * @param string $session |
||
137 | * @param string $nic |
||
138 | * @param string $name |
||
139 | * @param string $firstname |
||
140 | * @param string $sex |
||
141 | * @param string $legalForm |
||
142 | * @param string $organisation |
||
143 | * @param string $legalName |
||
144 | * @param string $legalNumber |
||
145 | * @param string $vat |
||
146 | * @param string $birthDay |
||
147 | * @param string $birthCity |
||
148 | * @param string $nationalIdentificationNumber |
||
149 | * @param string $companyNationalIdentificationNumber |
||
150 | * @param string $corporationType |
||
151 | */ |
||
152 | public function __construct($session = null, $nic = null, $name = null, $firstname = null, $sex = null, $legalForm = null, $organisation = null, $legalName = null, $legalNumber = null, $vat = null, $birthDay = null, $birthCity = null, $nationalIdentificationNumber = null, $companyNationalIdentificationNumber = null, $corporationType = null) |
||
153 | { |
||
154 | $this |
||
155 | ->setSession($session) |
||
156 | ->setNic($nic) |
||
157 | ->setName($name) |
||
158 | ->setFirstname($firstname) |
||
159 | ->setSex($sex) |
||
160 | ->setLegalForm($legalForm) |
||
161 | ->setOrganisation($organisation) |
||
162 | ->setLegalName($legalName) |
||
163 | ->setLegalNumber($legalNumber) |
||
164 | ->setVat($vat) |
||
165 | ->setBirthDay($birthDay) |
||
166 | ->setBirthCity($birthCity) |
||
167 | ->setNationalIdentificationNumber($nationalIdentificationNumber) |
||
168 | ->setCompanyNationalIdentificationNumber($companyNationalIdentificationNumber) |
||
169 | ->setCorporationType($corporationType); |
||
170 | } |
||
171 | /** |
||
172 | * Get session value |
||
173 | * @return string|null |
||
174 | */ |
||
175 | public function getSession() |
||
176 | { |
||
177 | return $this->session; |
||
178 | } |
||
179 | /** |
||
180 | * Set session value |
||
181 | * @param string $session |
||
182 | * @return \Ovh\StructType\NicUpdateIT |
||
183 | */ |
||
184 | public function setSession($session = null) |
||
185 | { |
||
186 | // validation for constraint: string |
||
187 | if (!is_null($session) && !is_string($session)) { |
||
|
|||
188 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($session, true), gettype($session)), __LINE__); |
||
189 | } |
||
190 | $this->session = $session; |
||
191 | return $this; |
||
192 | } |
||
193 | /** |
||
194 | * Get nic value |
||
195 | * @return string|null |
||
196 | */ |
||
197 | public function getNic() |
||
198 | { |
||
199 | return $this->nic; |
||
200 | } |
||
201 | /** |
||
202 | * Set nic value |
||
203 | * @param string $nic |
||
204 | * @return \Ovh\StructType\NicUpdateIT |
||
205 | */ |
||
206 | public function setNic($nic = null) |
||
207 | { |
||
208 | // validation for constraint: string |
||
209 | if (!is_null($nic) && !is_string($nic)) { |
||
210 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nic, true), gettype($nic)), __LINE__); |
||
211 | } |
||
212 | $this->nic = $nic; |
||
213 | return $this; |
||
214 | } |
||
215 | /** |
||
216 | * Get name value |
||
217 | * @return string|null |
||
218 | */ |
||
219 | public function getName() |
||
220 | { |
||
221 | return $this->name; |
||
222 | } |
||
223 | /** |
||
224 | * Set name value |
||
225 | * @param string $name |
||
226 | * @return \Ovh\StructType\NicUpdateIT |
||
227 | */ |
||
228 | public function setName($name = null) |
||
229 | { |
||
230 | // validation for constraint: string |
||
231 | if (!is_null($name) && !is_string($name)) { |
||
232 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($name, true), gettype($name)), __LINE__); |
||
233 | } |
||
234 | $this->name = $name; |
||
235 | return $this; |
||
236 | } |
||
237 | /** |
||
238 | * Get firstname value |
||
239 | * @return string|null |
||
240 | */ |
||
241 | public function getFirstname() |
||
242 | { |
||
243 | return $this->firstname; |
||
244 | } |
||
245 | /** |
||
246 | * Set firstname value |
||
247 | * @param string $firstname |
||
248 | * @return \Ovh\StructType\NicUpdateIT |
||
249 | */ |
||
250 | public function setFirstname($firstname = null) |
||
251 | { |
||
252 | // validation for constraint: string |
||
253 | if (!is_null($firstname) && !is_string($firstname)) { |
||
254 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($firstname, true), gettype($firstname)), __LINE__); |
||
255 | } |
||
256 | $this->firstname = $firstname; |
||
257 | return $this; |
||
258 | } |
||
259 | /** |
||
260 | * Get sex value |
||
261 | * @return string|null |
||
262 | */ |
||
263 | public function getSex() |
||
264 | { |
||
265 | return $this->sex; |
||
266 | } |
||
267 | /** |
||
268 | * Set sex value |
||
269 | * @param string $sex |
||
270 | * @return \Ovh\StructType\NicUpdateIT |
||
271 | */ |
||
272 | public function setSex($sex = null) |
||
273 | { |
||
274 | // validation for constraint: string |
||
275 | if (!is_null($sex) && !is_string($sex)) { |
||
276 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($sex, true), gettype($sex)), __LINE__); |
||
277 | } |
||
278 | $this->sex = $sex; |
||
279 | return $this; |
||
280 | } |
||
281 | /** |
||
282 | * Get legalForm value |
||
283 | * @return string|null |
||
284 | */ |
||
285 | public function getLegalForm() |
||
286 | { |
||
287 | return $this->legalForm; |
||
288 | } |
||
289 | /** |
||
290 | * Set legalForm value |
||
291 | * @param string $legalForm |
||
292 | * @return \Ovh\StructType\NicUpdateIT |
||
293 | */ |
||
294 | public function setLegalForm($legalForm = null) |
||
295 | { |
||
296 | // validation for constraint: string |
||
297 | if (!is_null($legalForm) && !is_string($legalForm)) { |
||
298 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($legalForm, true), gettype($legalForm)), __LINE__); |
||
299 | } |
||
300 | $this->legalForm = $legalForm; |
||
301 | return $this; |
||
302 | } |
||
303 | /** |
||
304 | * Get organisation value |
||
305 | * @return string|null |
||
306 | */ |
||
307 | public function getOrganisation() |
||
308 | { |
||
309 | return $this->organisation; |
||
310 | } |
||
311 | /** |
||
312 | * Set organisation value |
||
313 | * @param string $organisation |
||
314 | * @return \Ovh\StructType\NicUpdateIT |
||
315 | */ |
||
316 | public function setOrganisation($organisation = null) |
||
324 | } |
||
325 | /** |
||
326 | * Get legalName value |
||
327 | * @return string|null |
||
328 | */ |
||
329 | public function getLegalName() |
||
330 | { |
||
331 | return $this->legalName; |
||
332 | } |
||
333 | /** |
||
334 | * Set legalName value |
||
335 | * @param string $legalName |
||
336 | * @return \Ovh\StructType\NicUpdateIT |
||
337 | */ |
||
338 | public function setLegalName($legalName = null) |
||
339 | { |
||
340 | // validation for constraint: string |
||
341 | if (!is_null($legalName) && !is_string($legalName)) { |
||
342 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($legalName, true), gettype($legalName)), __LINE__); |
||
343 | } |
||
344 | $this->legalName = $legalName; |
||
345 | return $this; |
||
346 | } |
||
347 | /** |
||
348 | * Get legalNumber value |
||
349 | * @return string|null |
||
350 | */ |
||
351 | public function getLegalNumber() |
||
352 | { |
||
353 | return $this->legalNumber; |
||
354 | } |
||
355 | /** |
||
356 | * Set legalNumber value |
||
357 | * @param string $legalNumber |
||
358 | * @return \Ovh\StructType\NicUpdateIT |
||
359 | */ |
||
360 | public function setLegalNumber($legalNumber = null) |
||
368 | } |
||
369 | /** |
||
370 | * Get vat value |
||
371 | * @return string|null |
||
372 | */ |
||
373 | public function getVat() |
||
374 | { |
||
375 | return $this->vat; |
||
376 | } |
||
377 | /** |
||
378 | * Set vat value |
||
379 | * @param string $vat |
||
380 | * @return \Ovh\StructType\NicUpdateIT |
||
381 | */ |
||
382 | public function setVat($vat = null) |
||
390 | } |
||
391 | /** |
||
392 | * Get birthDay value |
||
393 | * @return string|null |
||
394 | */ |
||
395 | public function getBirthDay() |
||
396 | { |
||
397 | return $this->birthDay; |
||
398 | } |
||
399 | /** |
||
400 | * Set birthDay value |
||
401 | * @param string $birthDay |
||
402 | * @return \Ovh\StructType\NicUpdateIT |
||
403 | */ |
||
404 | public function setBirthDay($birthDay = null) |
||
405 | { |
||
406 | // validation for constraint: string |
||
407 | if (!is_null($birthDay) && !is_string($birthDay)) { |
||
408 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($birthDay, true), gettype($birthDay)), __LINE__); |
||
409 | } |
||
410 | $this->birthDay = $birthDay; |
||
411 | return $this; |
||
412 | } |
||
413 | /** |
||
414 | * Get birthCity value |
||
415 | * @return string|null |
||
416 | */ |
||
417 | public function getBirthCity() |
||
418 | { |
||
419 | return $this->birthCity; |
||
420 | } |
||
421 | /** |
||
422 | * Set birthCity value |
||
423 | * @param string $birthCity |
||
424 | * @return \Ovh\StructType\NicUpdateIT |
||
425 | */ |
||
426 | public function setBirthCity($birthCity = null) |
||
434 | } |
||
435 | /** |
||
436 | * Get nationalIdentificationNumber value |
||
437 | * @return string|null |
||
438 | */ |
||
439 | public function getNationalIdentificationNumber() |
||
440 | { |
||
441 | return $this->nationalIdentificationNumber; |
||
442 | } |
||
443 | /** |
||
444 | * Set nationalIdentificationNumber value |
||
445 | * @param string $nationalIdentificationNumber |
||
446 | * @return \Ovh\StructType\NicUpdateIT |
||
447 | */ |
||
448 | public function setNationalIdentificationNumber($nationalIdentificationNumber = null) |
||
449 | { |
||
450 | // validation for constraint: string |
||
451 | if (!is_null($nationalIdentificationNumber) && !is_string($nationalIdentificationNumber)) { |
||
452 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($nationalIdentificationNumber, true), gettype($nationalIdentificationNumber)), __LINE__); |
||
453 | } |
||
454 | $this->nationalIdentificationNumber = $nationalIdentificationNumber; |
||
455 | return $this; |
||
456 | } |
||
457 | /** |
||
458 | * Get companyNationalIdentificationNumber value |
||
459 | * @return string|null |
||
460 | */ |
||
461 | public function getCompanyNationalIdentificationNumber() |
||
462 | { |
||
463 | return $this->companyNationalIdentificationNumber; |
||
464 | } |
||
465 | /** |
||
466 | * Set companyNationalIdentificationNumber value |
||
467 | * @param string $companyNationalIdentificationNumber |
||
468 | * @return \Ovh\StructType\NicUpdateIT |
||
469 | */ |
||
470 | public function setCompanyNationalIdentificationNumber($companyNationalIdentificationNumber = null) |
||
471 | { |
||
472 | // validation for constraint: string |
||
473 | if (!is_null($companyNationalIdentificationNumber) && !is_string($companyNationalIdentificationNumber)) { |
||
474 | throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($companyNationalIdentificationNumber, true), gettype($companyNationalIdentificationNumber)), __LINE__); |
||
475 | } |
||
476 | $this->companyNationalIdentificationNumber = $companyNationalIdentificationNumber; |
||
477 | return $this; |
||
478 | } |
||
479 | /** |
||
480 | * Get corporationType value |
||
481 | * @return string|null |
||
482 | */ |
||
483 | public function getCorporationType() |
||
484 | { |
||
485 | return $this->corporationType; |
||
486 | } |
||
487 | /** |
||
488 | * Set corporationType value |
||
489 | * @param string $corporationType |
||
490 | * @return \Ovh\StructType\NicUpdateIT |
||
491 | */ |
||
492 | public function setCorporationType($corporationType = null) |
||
500 | } |
||
501 | } |
||
502 |