Total Complexity | 53 |
Total Lines | 709 |
Duplicated Lines | 0 % |
Changes | 0 |
Complex classes like SkiDataUser 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 SkiDataUser, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
22 | class SkiDataUser { |
||
23 | |||
24 | /** |
||
25 | * Check licence plate. |
||
26 | * |
||
27 | * @var boolean |
||
28 | */ |
||
29 | private $checkLicensePlate; |
||
30 | |||
31 | /** |
||
32 | * Credit card number. |
||
33 | * |
||
34 | * @var string |
||
35 | */ |
||
36 | private $creditCardNumber; |
||
37 | |||
38 | /** |
||
39 | * Customer number. |
||
40 | * |
||
41 | * @var integer |
||
42 | */ |
||
43 | private $customerNumber; |
||
44 | |||
45 | /** |
||
46 | * Date of birth. |
||
47 | * |
||
48 | * @var DateTime |
||
49 | */ |
||
50 | private $dateBirth; |
||
51 | |||
52 | /** |
||
53 | * Date/time of last modification. |
||
54 | * |
||
55 | * @var DateTime |
||
56 | */ |
||
57 | private $datetimeLastModification; |
||
58 | |||
59 | /** |
||
60 | * Deleted record. |
||
61 | * |
||
62 | * @var boolean |
||
63 | */ |
||
64 | private $deletedRecord; |
||
65 | |||
66 | /** |
||
67 | * Division. |
||
68 | * |
||
69 | * @var string |
||
70 | */ |
||
71 | private $division; |
||
72 | |||
73 | /** |
||
74 | * E-ticket authentication. |
||
75 | * |
||
76 | * @var integer |
||
77 | */ |
||
78 | private $eTicketAuthentication; |
||
79 | |||
80 | /** |
||
81 | * E-ticket email/telephone. |
||
82 | * |
||
83 | * @var string |
||
84 | */ |
||
85 | private $eTicketEmailTelephone; |
||
86 | |||
87 | /** |
||
88 | * E-ticket service art. |
||
89 | * |
||
90 | * @var integer |
||
91 | */ |
||
92 | private $eTicketServiceArt; |
||
93 | |||
94 | /** |
||
95 | * E-ticket service typ. |
||
96 | * |
||
97 | * @var integer |
||
98 | */ |
||
99 | private $eTicketServiceTyp; |
||
100 | |||
101 | /** |
||
102 | * E-ticket type p |
||
103 | * |
||
104 | * @var integer |
||
105 | */ |
||
106 | private $eTicketTypeP; |
||
107 | |||
108 | /** |
||
109 | * Email. |
||
110 | * |
||
111 | * @var string |
||
112 | */ |
||
113 | private $email; |
||
114 | |||
115 | /** |
||
116 | * Excess times with creadit card. |
||
117 | * |
||
118 | * @var boolean |
||
119 | */ |
||
120 | private $excessTimesCreditCard; |
||
121 | |||
122 | /** |
||
123 | * Expiry date. |
||
124 | * |
||
125 | * @var DateTime |
||
126 | */ |
||
127 | private $expiryDate; |
||
128 | |||
129 | /** |
||
130 | * Firstname. |
||
131 | * |
||
132 | * @var string |
||
133 | */ |
||
134 | private $firstname; |
||
135 | |||
136 | /** |
||
137 | * Group counting. |
||
138 | * |
||
139 | * @var boolean |
||
140 | */ |
||
141 | private $groupCounting; |
||
142 | |||
143 | /** |
||
144 | * Identification number. |
||
145 | * |
||
146 | * @var string |
||
147 | */ |
||
148 | private $identificationNumber; |
||
149 | |||
150 | /** |
||
151 | * Parking space. |
||
152 | * |
||
153 | * @var string |
||
154 | */ |
||
155 | private $parkingSpace; |
||
156 | |||
157 | /** |
||
158 | * Passage with license plate permitted |
||
159 | * |
||
160 | * @var boolean |
||
161 | */ |
||
162 | private $passageLicensePlatePermitted; |
||
163 | |||
164 | /** |
||
165 | * Remarks. |
||
166 | * |
||
167 | * @var string |
||
168 | */ |
||
169 | private $remarks; |
||
170 | |||
171 | /** |
||
172 | * Remarks 2. |
||
173 | * |
||
174 | * @var string |
||
175 | */ |
||
176 | private $remarks2; |
||
177 | |||
178 | /** |
||
179 | * Remarks 3. |
||
180 | * |
||
181 | * @var string |
||
182 | */ |
||
183 | private $remarks3; |
||
184 | |||
185 | /** |
||
186 | * Username. |
||
187 | * |
||
188 | * @var string |
||
189 | */ |
||
190 | private $surname; |
||
191 | |||
192 | /** |
||
193 | * Title. |
||
194 | * |
||
195 | * @var string |
||
196 | */ |
||
197 | private $title; |
||
198 | |||
199 | /** |
||
200 | * User number. |
||
201 | * |
||
202 | * @var integer |
||
203 | */ |
||
204 | private $userNumber; |
||
205 | |||
206 | /** |
||
207 | * Constructor. |
||
208 | */ |
||
209 | public function __construct() { |
||
210 | // NOTHING TO DO. |
||
211 | } |
||
212 | |||
213 | /** |
||
214 | * Get the check licence plate. |
||
215 | * |
||
216 | * @return boolean Returns the check licence plate |
||
217 | */ |
||
218 | public function getCheckLicensePlate() { |
||
219 | return $this->checkLicensePlate; |
||
220 | } |
||
221 | |||
222 | /** |
||
223 | * Get the credit card number. |
||
224 | * |
||
225 | * @return string Returns the credit card number. |
||
226 | */ |
||
227 | public function getCreditCardNumber() { |
||
228 | return $this->creditCardNumber; |
||
229 | } |
||
230 | |||
231 | /** |
||
232 | * Get the customer number. |
||
233 | * |
||
234 | * @return integer Returns the customer number. |
||
235 | */ |
||
236 | public function getCustomerNumber() { |
||
237 | return $this->customerNumber; |
||
238 | } |
||
239 | |||
240 | /** |
||
241 | * Get the date of birth. |
||
242 | * |
||
243 | * @return DateTime Returns the date of birth. |
||
244 | */ |
||
245 | public function getDateBirth() { |
||
246 | return $this->dateBirth; |
||
247 | } |
||
248 | |||
249 | /** |
||
250 | * Get the date/time of last modification. |
||
251 | * |
||
252 | * @return DateTime Returns the date/time of last modification. |
||
253 | */ |
||
254 | public function getDatetimeLastModification() { |
||
255 | return $this->datetimeLastModification; |
||
256 | } |
||
257 | |||
258 | /** |
||
259 | * Get the deleted record. |
||
260 | * |
||
261 | * @return boolean Returns the deleted record. |
||
262 | */ |
||
263 | public function getDeletedRecord() { |
||
264 | return $this->deletedRecord; |
||
265 | } |
||
266 | |||
267 | /** |
||
268 | * Get the division. |
||
269 | * |
||
270 | * @return string Returns the division. |
||
271 | */ |
||
272 | public function getDivision() { |
||
273 | return $this->division; |
||
274 | } |
||
275 | |||
276 | /** |
||
277 | * Get the E-ticket authentication. |
||
278 | * |
||
279 | * @return integer Returns the E-ticket authentication. |
||
280 | */ |
||
281 | public function getETicketAuthentication() { |
||
282 | return $this->eTicketAuthentication; |
||
283 | } |
||
284 | |||
285 | /** |
||
286 | * Get the E-ticket email/telephone. |
||
287 | * |
||
288 | * @return string Returns the E-ticket email/telephone. |
||
289 | */ |
||
290 | public function getETicketEmailTelephone() { |
||
291 | return $this->eTicketEmailTelephone; |
||
292 | } |
||
293 | |||
294 | /** |
||
295 | * Get the E-ticket service art. |
||
296 | * |
||
297 | * @return integer Returns the E-ticket service art. |
||
298 | */ |
||
299 | public function getETicketServiceArt() { |
||
300 | return $this->eTicketServiceArt; |
||
301 | } |
||
302 | |||
303 | /** |
||
304 | * Get the E-ticket service typ. |
||
305 | * |
||
306 | * @return integer Returns the E-ticket service typ. |
||
307 | */ |
||
308 | public function getETicketServiceTyp() { |
||
309 | return $this->eTicketServiceTyp; |
||
310 | } |
||
311 | |||
312 | /** |
||
313 | * Get the E-ticket type p. |
||
314 | * |
||
315 | * @return integer Returns the E-ticket type p. |
||
316 | */ |
||
317 | public function getETicketTypeP() { |
||
318 | return $this->eTicketTypeP; |
||
319 | } |
||
320 | |||
321 | /** |
||
322 | * Get the email. |
||
323 | * |
||
324 | * @return string Returns the email. |
||
325 | */ |
||
326 | public function getEmail() { |
||
327 | return $this->email; |
||
328 | } |
||
329 | |||
330 | /** |
||
331 | * Get the excess times with credit card. |
||
332 | * |
||
333 | * @return boolean Returns the excess times with credit card. |
||
334 | */ |
||
335 | public function getExcessTimesCreditCard() { |
||
336 | return $this->excessTimesCreditCard; |
||
337 | } |
||
338 | |||
339 | /** |
||
340 | * Get the expiry date. |
||
341 | * |
||
342 | * @return DateTime Returns the expiry date. |
||
343 | */ |
||
344 | public function getExpiryDate() { |
||
345 | return $this->expiryDate; |
||
346 | } |
||
347 | |||
348 | /** |
||
349 | * Get the firstname. |
||
350 | * |
||
351 | * @return string Returns the firstname. |
||
352 | */ |
||
353 | public function getFirstname() { |
||
354 | return $this->firstname; |
||
355 | } |
||
356 | |||
357 | /** |
||
358 | * Get the group counting. |
||
359 | * |
||
360 | * @return boolean Returns the group counting. |
||
361 | */ |
||
362 | public function getGroupCounting() { |
||
363 | return $this->groupCounting; |
||
364 | } |
||
365 | |||
366 | /** |
||
367 | * Get the identifiation number. |
||
368 | * |
||
369 | * @return string Returns the identification number. |
||
370 | */ |
||
371 | public function getIdentificationNumber() { |
||
372 | return $this->identificationNumber; |
||
373 | } |
||
374 | |||
375 | /** |
||
376 | * Get the parking space. |
||
377 | * |
||
378 | * @return string Returns the parking space. |
||
379 | */ |
||
380 | public function getParkingSpace() { |
||
381 | return $this->parkingSpace; |
||
382 | } |
||
383 | |||
384 | /** |
||
385 | * Get the passage with license plate permitted. |
||
386 | * |
||
387 | * @return boolean Returns teh passage with license plate permitted. |
||
388 | */ |
||
389 | public function getPassageLicensePlatePermitted() { |
||
390 | return $this->passageLicensePlatePermitted; |
||
391 | } |
||
392 | |||
393 | /** |
||
394 | * Get the remarks. |
||
395 | * |
||
396 | * @return string Returns the remarks. |
||
397 | */ |
||
398 | public function getRemarks() { |
||
399 | return $this->remarks; |
||
400 | } |
||
401 | |||
402 | /** |
||
403 | * Get the remarks 2. |
||
404 | * |
||
405 | * @return string Returns the remarks 2. |
||
406 | */ |
||
407 | public function getRemarks2() { |
||
408 | return $this->remarks2; |
||
409 | } |
||
410 | |||
411 | /** |
||
412 | * Get the remarks 3. |
||
413 | * |
||
414 | * @return string Returns the remarks 3. |
||
415 | */ |
||
416 | public function getRemarks3() { |
||
417 | return $this->remarks3; |
||
418 | } |
||
419 | |||
420 | /** |
||
421 | * Get the surname. |
||
422 | * |
||
423 | * @return string Returns the surname. |
||
424 | */ |
||
425 | public function getSurname() { |
||
426 | return $this->surname; |
||
427 | } |
||
428 | |||
429 | /** |
||
430 | * Get the title. |
||
431 | * |
||
432 | * @return string Returns the title. |
||
433 | */ |
||
434 | public function getTitle() { |
||
435 | return $this->title; |
||
436 | } |
||
437 | |||
438 | /** |
||
439 | * Get the user number. |
||
440 | * |
||
441 | * @return integer Returns the user number. |
||
442 | */ |
||
443 | public function getUserNumber() { |
||
444 | return $this->userNumber; |
||
445 | } |
||
446 | |||
447 | /** |
||
448 | * Set the check with license plate. |
||
449 | * |
||
450 | * @param boolean $checkLicensePlate The check with license plate. |
||
451 | * @return SkiDataUser Returns the SkiData user entity. |
||
452 | */ |
||
453 | public function setCheckLicensePlate($checkLicensePlate) { |
||
454 | $this->checkLicensePlate = $checkLicensePlate; |
||
455 | return $this; |
||
456 | } |
||
457 | |||
458 | /** |
||
459 | * Set the credit card number. |
||
460 | * |
||
461 | * @param string $creditCardNumber The credit card number. |
||
462 | * @return SkiDataUser Returns the SkiData user entity. |
||
463 | */ |
||
464 | public function setCreditCardNumber($creditCardNumber) { |
||
465 | $this->creditCardNumber = $creditCardNumber; |
||
466 | return $this; |
||
467 | } |
||
468 | |||
469 | /** |
||
470 | * Set the customer number. |
||
471 | * |
||
472 | * @param integer $customerNumber The customer number. |
||
473 | * @return SkiDataUser Returns the SkiData user entity. |
||
474 | */ |
||
475 | public function setCustomerNumber($customerNumber) { |
||
476 | $this->customerNumber = $customerNumber; |
||
477 | return $this; |
||
478 | } |
||
479 | |||
480 | /** |
||
481 | * Set the date of birth. |
||
482 | * |
||
483 | * @param DateTime $dateBirth The date of birth. |
||
484 | * @return SkiDataUser Returns the SkiData user entity. |
||
485 | */ |
||
486 | public function setDateBirth(DateTime $dateBirth = null) { |
||
487 | $this->dateBirth = $dateBirth; |
||
488 | return $this; |
||
489 | } |
||
490 | |||
491 | /** |
||
492 | * Set the date/time of last modification. |
||
493 | * |
||
494 | * @param DateTime $datetimeLastModification The date/time of last modification. |
||
495 | * @return SkiDataUser Returns the SkiData user entity. |
||
496 | */ |
||
497 | public function setDatetimeLastModification(DateTime $datetimeLastModification = null) { |
||
498 | $this->datetimeLastModification = $datetimeLastModification; |
||
499 | return $this; |
||
500 | } |
||
501 | |||
502 | /** |
||
503 | * Set the deleted record. |
||
504 | * |
||
505 | * @param boolean $deletedRecord The deleted record. |
||
506 | * @return SkiDataUser Returns the SkiData user entity. |
||
507 | */ |
||
508 | public function setDeletedRecord($deletedRecord) { |
||
509 | $this->deletedRecord = $deletedRecord; |
||
510 | return $this; |
||
511 | } |
||
512 | |||
513 | /** |
||
514 | * Set the division. |
||
515 | * |
||
516 | * @param string $division The division. |
||
517 | * @return SkiDataUser Returns the SkiData user entity. |
||
518 | */ |
||
519 | public function setDivision($division) { |
||
520 | $this->division = $division; |
||
521 | return $this; |
||
522 | } |
||
523 | |||
524 | /** |
||
525 | * Set the E-ticket authentication. |
||
526 | * |
||
527 | * @param integer $eTicketAuthentication The E-ticket authentication. |
||
528 | * @return SkiDataUser Returns the SkiData user entity. |
||
529 | */ |
||
530 | public function setETicketAuthentication($eTicketAuthentication) { |
||
531 | $this->eTicketAuthentication = $eTicketAuthentication; |
||
532 | return $this; |
||
533 | } |
||
534 | |||
535 | /** |
||
536 | * Set the E-ticket email/telephone. |
||
537 | * |
||
538 | * @param string $eTicketEmailTelephone The E-ticket email/telephone. |
||
539 | * @return SkiDataUser Returns the SkiData user entity. |
||
540 | */ |
||
541 | public function setETicketEmailTelephone($eTicketEmailTelephone) { |
||
542 | $this->eTicketEmailTelephone = $eTicketEmailTelephone; |
||
543 | return $this; |
||
544 | } |
||
545 | |||
546 | /** |
||
547 | * Set the E-ticket service art. |
||
548 | * |
||
549 | * @param integer $eTicketServiceArt The E-ticket service art. |
||
550 | * @return SkiDataUser Returns the SkiData user entity. |
||
551 | */ |
||
552 | public function setETicketServiceArt($eTicketServiceArt) { |
||
553 | $this->eTicketServiceArt = $eTicketServiceArt; |
||
554 | return $this; |
||
555 | } |
||
556 | |||
557 | /** |
||
558 | * Set the E-ticket service typ. |
||
559 | * |
||
560 | * @param integer $eTicketServiceTyp The E-ticket service typ. |
||
561 | * @return SkiDataUser Returns the SkiData user entity. |
||
562 | */ |
||
563 | public function setETicketServiceTyp($eTicketServiceTyp) { |
||
564 | $this->eTicketServiceTyp = $eTicketServiceTyp; |
||
565 | return $this; |
||
566 | } |
||
567 | |||
568 | /** |
||
569 | * Set the E-ticket type p. |
||
570 | * |
||
571 | * @param integer $eTicketTypeP The E-ticket type p. |
||
572 | * @return SkiDataUser Returns the SkiData user entity. |
||
573 | */ |
||
574 | public function setETicketTypeP($eTicketTypeP) { |
||
575 | $this->eTicketTypeP = $eTicketTypeP; |
||
576 | return $this; |
||
577 | } |
||
578 | |||
579 | /** |
||
580 | * Set the email. |
||
581 | * |
||
582 | * @param string $email The email. |
||
583 | * @return SkiDataUser Returns the SkiData user entity. |
||
584 | */ |
||
585 | public function setEmail($email) { |
||
588 | } |
||
589 | |||
590 | /** |
||
591 | * Set the excess times with credit card. |
||
592 | * |
||
593 | * @param boolean $excessTimesCreditCard The excess times with credit card. |
||
594 | * @return SkiDataUser Returns the SkiData user entity. |
||
595 | */ |
||
596 | public function setExcessTimesCreditCard($excessTimesCreditCard) { |
||
599 | } |
||
600 | |||
601 | /** |
||
602 | * Set the expiry date. |
||
603 | * |
||
604 | * @param DateTime $expiryDate The expiry date. |
||
605 | * @return SkiDataUser Returns the SkiData user entity. |
||
606 | */ |
||
607 | public function setExpiryDate(DateTime $expiryDate = null) { |
||
608 | $this->expiryDate = $expiryDate; |
||
609 | return $this; |
||
610 | } |
||
611 | |||
612 | /** |
||
613 | * Set the firstname. |
||
614 | * |
||
615 | * @param string $firstname The firstname. |
||
616 | * @return SkiDataUser Returns the SkiData user entity. |
||
617 | */ |
||
618 | public function setFirstname($firstname) { |
||
619 | $this->firstname = $firstname; |
||
620 | return $this; |
||
621 | } |
||
622 | |||
623 | /** |
||
624 | * Set the group counting. |
||
625 | * |
||
626 | * @param boolean $groupCounting The group counting. |
||
627 | * @return SkiDataUser Returns the SkiData user entity. |
||
628 | */ |
||
629 | public function setGroupCounting($groupCounting) { |
||
630 | $this->groupCounting = $groupCounting; |
||
631 | return $this; |
||
632 | } |
||
633 | |||
634 | /** |
||
635 | * Set the identification number. |
||
636 | * |
||
637 | * @param string $identificationNumber The identification number. |
||
638 | * @return SkiDataUser Returns the SkiData user entity. |
||
639 | */ |
||
640 | public function setIdentificationNumber($identificationNumber) { |
||
641 | $this->identificationNumber = $identificationNumber; |
||
642 | return $this; |
||
643 | } |
||
644 | |||
645 | /** |
||
646 | * Set the parking space. |
||
647 | * |
||
648 | * @param string $parkingSpace The parking space. |
||
649 | * @return SkiDataUser Returns the SkiData user entity. |
||
650 | */ |
||
651 | public function setParkingSpace($parkingSpace) { |
||
652 | $this->parkingSpace = $parkingSpace; |
||
653 | return $this; |
||
654 | } |
||
655 | |||
656 | /** |
||
657 | * Set the passage with license plate permitted. |
||
658 | * |
||
659 | * @return SkiDataUser Returns the SkiData user entity. |
||
660 | * @param boolean $passageLicensePlatePermitted The passage with license plate permitted. |
||
661 | */ |
||
662 | public function setPassageLicensePlatePermitted($passageLicensePlatePermitted) { |
||
665 | } |
||
666 | |||
667 | /** |
||
668 | * Set the remarks. |
||
669 | * |
||
670 | * @param string $remarks The remarks. |
||
671 | * @return SkiDataUser Returns the SkiData user entity. |
||
672 | */ |
||
673 | public function setRemarks($remarks) { |
||
674 | $this->remarks = $remarks; |
||
675 | return $this; |
||
676 | } |
||
677 | |||
678 | /** |
||
679 | * Set the remarks 2. |
||
680 | * |
||
681 | * @param string $remarks2 The remarks 2. |
||
682 | * @return SkiDataUser Returns the SkiData user entity. |
||
683 | */ |
||
684 | public function setRemarks2($remarks2) { |
||
687 | } |
||
688 | |||
689 | /** |
||
690 | * Set the remarks 3. |
||
691 | * |
||
692 | * @param string $remarks3 The remarks 3. |
||
693 | * @return SkiDataUser Returns the SkiData user entity. |
||
694 | */ |
||
695 | public function setRemarks3($remarks3) { |
||
698 | } |
||
699 | |||
700 | /** |
||
701 | * Set the surname. |
||
702 | * |
||
703 | * @param string $surname The surname. |
||
704 | * @return SkiDataUser Returns the SkiData user entity. |
||
705 | */ |
||
706 | public function setSurname($surname) { |
||
707 | $this->surname = $surname; |
||
708 | return $this; |
||
709 | } |
||
710 | |||
711 | /** |
||
712 | * Set the title. |
||
713 | * |
||
714 | * @param string $title The title. |
||
715 | * @return SkiDataUser Returns the SkiData user entity. |
||
716 | */ |
||
717 | public function setTitle($title) { |
||
718 | $this->title = $title; |
||
719 | return $this; |
||
720 | } |
||
721 | |||
722 | /** |
||
723 | * Set the user number. |
||
724 | * |
||
725 | * @param integer $userNumber The user number. |
||
726 | * @return SkiDataUser Returns the SkiData user entity. |
||
727 | */ |
||
728 | public function setUserNumber($userNumber) { |
||
731 | } |
||
732 | |||
733 | } |
||
734 |