Complex classes like TCollectionExpressionType 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. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
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 TCollectionExpressionType, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
11 | class TCollectionExpressionType |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * @property string $binary |
||
16 | */ |
||
17 | private $binary = null; |
||
18 | |||
19 | /** |
||
20 | * @property boolean $bool |
||
21 | */ |
||
22 | private $bool = null; |
||
23 | |||
24 | /** |
||
25 | * @property \DateTime $date |
||
26 | */ |
||
27 | private $date = null; |
||
28 | |||
29 | /** |
||
30 | * @property \DateTime $dateTimeOffset |
||
31 | */ |
||
32 | private $dateTimeOffset = null; |
||
33 | |||
34 | /** |
||
35 | * @property float $decimal |
||
36 | */ |
||
37 | private $decimal = null; |
||
38 | |||
39 | /** |
||
40 | * @property \DateInterval $duration |
||
41 | */ |
||
42 | private $duration = null; |
||
43 | |||
44 | /** |
||
45 | * @property string[] $enumMember |
||
46 | */ |
||
47 | private $enumMember = null; |
||
48 | |||
49 | /** |
||
50 | * @property float $float |
||
51 | */ |
||
52 | private $float = null; |
||
53 | |||
54 | /** |
||
55 | * @property string $guid |
||
56 | */ |
||
57 | private $guid = null; |
||
58 | |||
59 | /** |
||
60 | * @property integer $int |
||
61 | */ |
||
62 | private $int = null; |
||
63 | |||
64 | /** |
||
65 | * @property string $string |
||
66 | */ |
||
67 | private $string = null; |
||
68 | |||
69 | /** |
||
70 | * @property \DateTime $timeOfDay |
||
71 | */ |
||
72 | private $timeOfDay = null; |
||
73 | |||
74 | /** |
||
75 | * @property string $annotationPath |
||
76 | */ |
||
77 | private $annotationPath = null; |
||
78 | |||
79 | /** |
||
80 | * @property \MetadataV4\edm\TApplyExpressionType $apply |
||
81 | */ |
||
82 | private $apply = null; |
||
83 | |||
84 | /** |
||
85 | * @property \MetadataV4\edm\TCastOrIsOfExpressionType $cast |
||
86 | */ |
||
87 | private $cast = null; |
||
88 | |||
89 | /** |
||
90 | * @property \MetadataV4\edm\TCollectionExpressionType $collection |
||
91 | */ |
||
92 | private $collection = null; |
||
93 | |||
94 | /** |
||
95 | * @property \MetadataV4\edm\TIfExpressionType $if |
||
96 | */ |
||
97 | private $if = null; |
||
98 | |||
99 | /** |
||
100 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $eq |
||
101 | */ |
||
102 | private $eq = null; |
||
103 | |||
104 | /** |
||
105 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $ne |
||
106 | */ |
||
107 | private $ne = null; |
||
108 | |||
109 | /** |
||
110 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $ge |
||
111 | */ |
||
112 | private $ge = null; |
||
113 | |||
114 | /** |
||
115 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $gt |
||
116 | */ |
||
117 | private $gt = null; |
||
118 | |||
119 | /** |
||
120 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $le |
||
121 | */ |
||
122 | private $le = null; |
||
123 | |||
124 | /** |
||
125 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $lt |
||
126 | */ |
||
127 | private $lt = null; |
||
128 | |||
129 | /** |
||
130 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $and |
||
131 | */ |
||
132 | private $and = null; |
||
133 | |||
134 | /** |
||
135 | * @property \MetadataV4\edm\TTwoChildrenExpressionType $or |
||
136 | */ |
||
137 | private $or = null; |
||
138 | |||
139 | /** |
||
140 | * @property \MetadataV4\edm\TOneChildExpressionType $not |
||
141 | */ |
||
142 | private $not = null; |
||
143 | |||
144 | /** |
||
145 | * @property \MetadataV4\edm\TCastOrIsOfExpressionType $isOf |
||
146 | */ |
||
147 | private $isOf = null; |
||
148 | |||
149 | /** |
||
150 | * @property \MetadataV4\edm\TLabeledElementExpressionType $labeledElement |
||
151 | */ |
||
152 | private $labeledElement = null; |
||
153 | |||
154 | /** |
||
155 | * @property string $labeledElementReference |
||
156 | */ |
||
157 | private $labeledElementReference = null; |
||
158 | |||
159 | /** |
||
160 | * @property \MetadataV4\edm\Annotation[] $null |
||
161 | */ |
||
162 | private $null = null; |
||
163 | |||
164 | /** |
||
165 | * @property string $navigationPropertyPath |
||
166 | */ |
||
167 | private $navigationPropertyPath = null; |
||
168 | |||
169 | /** |
||
170 | * @property string $path |
||
171 | */ |
||
172 | private $path = null; |
||
173 | |||
174 | /** |
||
175 | * @property string $propertyPath |
||
176 | */ |
||
177 | private $propertyPath = null; |
||
178 | |||
179 | /** |
||
180 | * @property \MetadataV4\edm\TRecordExpressionType $record |
||
181 | */ |
||
182 | private $record = null; |
||
183 | |||
184 | /** |
||
185 | * @property \MetadataV4\edm\TOneChildExpressionType $urlRef |
||
186 | */ |
||
187 | private $urlRef = null; |
||
188 | |||
189 | /** |
||
190 | * Gets as binary |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function getBinary() |
||
198 | |||
199 | /** |
||
200 | * Sets a new binary |
||
201 | * |
||
202 | * @param string $binary |
||
203 | * @return self |
||
204 | */ |
||
205 | public function setBinary($binary) |
||
210 | |||
211 | /** |
||
212 | * Gets as bool |
||
213 | * |
||
214 | * @return boolean |
||
215 | */ |
||
216 | public function getBool() |
||
220 | |||
221 | /** |
||
222 | * Sets a new bool |
||
223 | * |
||
224 | * @param boolean $bool |
||
225 | * @return self |
||
226 | */ |
||
227 | public function setBool($bool) |
||
232 | |||
233 | /** |
||
234 | * Gets as date |
||
235 | * |
||
236 | * @return \DateTime |
||
237 | */ |
||
238 | public function getDate() |
||
242 | |||
243 | /** |
||
244 | * Sets a new date |
||
245 | * |
||
246 | * @param \DateTime $date |
||
247 | * @return self |
||
248 | */ |
||
249 | public function setDate(\DateTime $date) |
||
254 | |||
255 | /** |
||
256 | * Gets as dateTimeOffset |
||
257 | * |
||
258 | * @return \DateTime |
||
259 | */ |
||
260 | public function getDateTimeOffset() |
||
264 | |||
265 | /** |
||
266 | * Sets a new dateTimeOffset |
||
267 | * |
||
268 | * @param \DateTime $dateTimeOffset |
||
269 | * @return self |
||
270 | */ |
||
271 | public function setDateTimeOffset(\DateTime $dateTimeOffset) |
||
276 | |||
277 | /** |
||
278 | * Gets as decimal |
||
279 | * |
||
280 | * @return float |
||
281 | */ |
||
282 | public function getDecimal() |
||
286 | |||
287 | /** |
||
288 | * Sets a new decimal |
||
289 | * |
||
290 | * @param float $decimal |
||
291 | * @return self |
||
292 | */ |
||
293 | public function setDecimal($decimal) |
||
298 | |||
299 | /** |
||
300 | * Gets as duration |
||
301 | * |
||
302 | * @return \DateInterval |
||
303 | */ |
||
304 | public function getDuration() |
||
308 | |||
309 | /** |
||
310 | * Sets a new duration |
||
311 | * |
||
312 | * @param \DateInterval $duration |
||
313 | * @return self |
||
314 | */ |
||
315 | public function setDuration(\DateInterval $duration) |
||
320 | |||
321 | /** |
||
322 | * Adds as enumMember |
||
323 | * |
||
324 | * @return self |
||
325 | * @param string $enumMember |
||
326 | */ |
||
327 | public function addToEnumMember($enumMember) |
||
332 | |||
333 | /** |
||
334 | * isset enumMember |
||
335 | * |
||
336 | * @param scalar $index |
||
337 | * @return boolean |
||
338 | */ |
||
339 | public function issetEnumMember($index) |
||
343 | |||
344 | /** |
||
345 | * unset enumMember |
||
346 | * |
||
347 | * @param scalar $index |
||
348 | * @return void |
||
349 | */ |
||
350 | public function unsetEnumMember($index) |
||
354 | |||
355 | /** |
||
356 | * Gets as enumMember |
||
357 | * |
||
358 | * @return string[] |
||
359 | */ |
||
360 | public function getEnumMember() |
||
364 | |||
365 | /** |
||
366 | * Sets a new enumMember |
||
367 | * |
||
368 | * @param string $enumMember |
||
369 | * @return self |
||
370 | */ |
||
371 | public function setEnumMember(array $enumMember) |
||
376 | |||
377 | /** |
||
378 | * Gets as float |
||
379 | * |
||
380 | * @return float |
||
381 | */ |
||
382 | public function getFloat() |
||
386 | |||
387 | /** |
||
388 | * Sets a new float |
||
389 | * |
||
390 | * @param float $float |
||
391 | * @return self |
||
392 | */ |
||
393 | public function setFloat($float) |
||
398 | |||
399 | /** |
||
400 | * Gets as guid |
||
401 | * |
||
402 | * @return string |
||
403 | */ |
||
404 | public function getGuid() |
||
408 | |||
409 | /** |
||
410 | * Sets a new guid |
||
411 | * |
||
412 | * @param string $guid |
||
413 | * @return self |
||
414 | */ |
||
415 | public function setGuid($guid) |
||
420 | |||
421 | /** |
||
422 | * Gets as int |
||
423 | * |
||
424 | * @return integer |
||
425 | */ |
||
426 | public function getInt() |
||
430 | |||
431 | /** |
||
432 | * Sets a new int |
||
433 | * |
||
434 | * @param integer $int |
||
435 | * @return self |
||
436 | */ |
||
437 | public function setInt($int) |
||
442 | |||
443 | /** |
||
444 | * Gets as string |
||
445 | * |
||
446 | * @return string |
||
447 | */ |
||
448 | public function getString() |
||
452 | |||
453 | /** |
||
454 | * Sets a new string |
||
455 | * |
||
456 | * @param string $string |
||
457 | * @return self |
||
458 | */ |
||
459 | public function setString($string) |
||
464 | |||
465 | /** |
||
466 | * Gets as timeOfDay |
||
467 | * |
||
468 | * @return \DateTime |
||
469 | */ |
||
470 | public function getTimeOfDay() |
||
474 | |||
475 | /** |
||
476 | * Sets a new timeOfDay |
||
477 | * |
||
478 | * @param \DateTime $timeOfDay |
||
479 | * @return self |
||
480 | */ |
||
481 | public function setTimeOfDay(\DateTime $timeOfDay) |
||
486 | |||
487 | /** |
||
488 | * Gets as annotationPath |
||
489 | * |
||
490 | * @return string |
||
491 | */ |
||
492 | public function getAnnotationPath() |
||
496 | |||
497 | /** |
||
498 | * Sets a new annotationPath |
||
499 | * |
||
500 | * @param string $annotationPath |
||
501 | * @return self |
||
502 | */ |
||
503 | public function setAnnotationPath($annotationPath) |
||
508 | |||
509 | /** |
||
510 | * Gets as apply |
||
511 | * |
||
512 | * @return \MetadataV4\edm\TApplyExpressionType |
||
513 | */ |
||
514 | public function getApply() |
||
518 | |||
519 | /** |
||
520 | * Sets a new apply |
||
521 | * |
||
522 | * @param \MetadataV4\edm\TApplyExpressionType $apply |
||
523 | * @return self |
||
524 | */ |
||
525 | public function setApply(\MetadataV4\edm\TApplyExpressionType $apply) |
||
530 | |||
531 | /** |
||
532 | * Gets as cast |
||
533 | * |
||
534 | * @return \MetadataV4\edm\TCastOrIsOfExpressionType |
||
535 | */ |
||
536 | public function getCast() |
||
540 | |||
541 | /** |
||
542 | * Sets a new cast |
||
543 | * |
||
544 | * @param \MetadataV4\edm\TCastOrIsOfExpressionType $cast |
||
545 | * @return self |
||
546 | */ |
||
547 | public function setCast(\MetadataV4\edm\TCastOrIsOfExpressionType $cast) |
||
552 | |||
553 | /** |
||
554 | * Gets as collection |
||
555 | * |
||
556 | * @return \MetadataV4\edm\TCollectionExpressionType |
||
557 | */ |
||
558 | public function getCollection() |
||
562 | |||
563 | /** |
||
564 | * Sets a new collection |
||
565 | * |
||
566 | * @param \MetadataV4\edm\TCollectionExpressionType $collection |
||
567 | * @return self |
||
568 | */ |
||
569 | public function setCollection(\MetadataV4\edm\TCollectionExpressionType $collection) |
||
574 | |||
575 | /** |
||
576 | * Gets as if |
||
577 | * |
||
578 | * @return \MetadataV4\edm\TIfExpressionType |
||
579 | */ |
||
580 | public function getIf() |
||
584 | |||
585 | /** |
||
586 | * Sets a new if |
||
587 | * |
||
588 | * @param \MetadataV4\edm\TIfExpressionType $if |
||
589 | * @return self |
||
590 | */ |
||
591 | public function setIf(\MetadataV4\edm\TIfExpressionType $if) |
||
596 | |||
597 | /** |
||
598 | * Gets as eq |
||
599 | * |
||
600 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
601 | */ |
||
602 | public function getEq() |
||
606 | |||
607 | /** |
||
608 | * Sets a new eq |
||
609 | * |
||
610 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $eq |
||
611 | * @return self |
||
612 | */ |
||
613 | public function setEq(\MetadataV4\edm\TTwoChildrenExpressionType $eq) |
||
618 | |||
619 | /** |
||
620 | * Gets as ne |
||
621 | * |
||
622 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
623 | */ |
||
624 | public function getNe() |
||
628 | |||
629 | /** |
||
630 | * Sets a new ne |
||
631 | * |
||
632 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $ne |
||
633 | * @return self |
||
634 | */ |
||
635 | public function setNe(\MetadataV4\edm\TTwoChildrenExpressionType $ne) |
||
640 | |||
641 | /** |
||
642 | * Gets as ge |
||
643 | * |
||
644 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
645 | */ |
||
646 | public function getGe() |
||
650 | |||
651 | /** |
||
652 | * Sets a new ge |
||
653 | * |
||
654 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $ge |
||
655 | * @return self |
||
656 | */ |
||
657 | public function setGe(\MetadataV4\edm\TTwoChildrenExpressionType $ge) |
||
662 | |||
663 | /** |
||
664 | * Gets as gt |
||
665 | * |
||
666 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
667 | */ |
||
668 | public function getGt() |
||
672 | |||
673 | /** |
||
674 | * Sets a new gt |
||
675 | * |
||
676 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $gt |
||
677 | * @return self |
||
678 | */ |
||
679 | public function setGt(\MetadataV4\edm\TTwoChildrenExpressionType $gt) |
||
684 | |||
685 | /** |
||
686 | * Gets as le |
||
687 | * |
||
688 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
689 | */ |
||
690 | public function getLe() |
||
694 | |||
695 | /** |
||
696 | * Sets a new le |
||
697 | * |
||
698 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $le |
||
699 | * @return self |
||
700 | */ |
||
701 | public function setLe(\MetadataV4\edm\TTwoChildrenExpressionType $le) |
||
706 | |||
707 | /** |
||
708 | * Gets as lt |
||
709 | * |
||
710 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
711 | */ |
||
712 | public function getLt() |
||
716 | |||
717 | /** |
||
718 | * Sets a new lt |
||
719 | * |
||
720 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $lt |
||
721 | * @return self |
||
722 | */ |
||
723 | public function setLt(\MetadataV4\edm\TTwoChildrenExpressionType $lt) |
||
728 | |||
729 | /** |
||
730 | * Gets as and |
||
731 | * |
||
732 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
733 | */ |
||
734 | public function getAnd() |
||
738 | |||
739 | /** |
||
740 | * Sets a new and |
||
741 | * |
||
742 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $and |
||
743 | * @return self |
||
744 | */ |
||
745 | public function setAnd(\MetadataV4\edm\TTwoChildrenExpressionType $and) |
||
750 | |||
751 | /** |
||
752 | * Gets as or |
||
753 | * |
||
754 | * @return \MetadataV4\edm\TTwoChildrenExpressionType |
||
755 | */ |
||
756 | public function getOr() |
||
760 | |||
761 | /** |
||
762 | * Sets a new or |
||
763 | * |
||
764 | * @param \MetadataV4\edm\TTwoChildrenExpressionType $or |
||
765 | * @return self |
||
766 | */ |
||
767 | public function setOr(\MetadataV4\edm\TTwoChildrenExpressionType $or) |
||
772 | |||
773 | /** |
||
774 | * Gets as not |
||
775 | * |
||
776 | * @return \MetadataV4\edm\TOneChildExpressionType |
||
777 | */ |
||
778 | public function getNot() |
||
782 | |||
783 | /** |
||
784 | * Sets a new not |
||
785 | * |
||
786 | * @param \MetadataV4\edm\TOneChildExpressionType $not |
||
787 | * @return self |
||
788 | */ |
||
789 | public function setNot(\MetadataV4\edm\TOneChildExpressionType $not) |
||
794 | |||
795 | /** |
||
796 | * Gets as isOf |
||
797 | * |
||
798 | * @return \MetadataV4\edm\TCastOrIsOfExpressionType |
||
799 | */ |
||
800 | public function getIsOf() |
||
804 | |||
805 | /** |
||
806 | * Sets a new isOf |
||
807 | * |
||
808 | * @param \MetadataV4\edm\TCastOrIsOfExpressionType $isOf |
||
809 | * @return self |
||
810 | */ |
||
811 | public function setIsOf(\MetadataV4\edm\TCastOrIsOfExpressionType $isOf) |
||
816 | |||
817 | /** |
||
818 | * Gets as labeledElement |
||
819 | * |
||
820 | * @return \MetadataV4\edm\TLabeledElementExpressionType |
||
821 | */ |
||
822 | public function getLabeledElement() |
||
826 | |||
827 | /** |
||
828 | * Sets a new labeledElement |
||
829 | * |
||
830 | * @param \MetadataV4\edm\TLabeledElementExpressionType $labeledElement |
||
831 | * @return self |
||
832 | */ |
||
833 | public function setLabeledElement(\MetadataV4\edm\TLabeledElementExpressionType $labeledElement) |
||
838 | |||
839 | /** |
||
840 | * Gets as labeledElementReference |
||
841 | * |
||
842 | * @return string |
||
843 | */ |
||
844 | public function getLabeledElementReference() |
||
848 | |||
849 | /** |
||
850 | * Sets a new labeledElementReference |
||
851 | * |
||
852 | * @param string $labeledElementReference |
||
853 | * @return self |
||
854 | */ |
||
855 | public function setLabeledElementReference($labeledElementReference) |
||
860 | |||
861 | /** |
||
862 | * Adds as annotation |
||
863 | * |
||
864 | * @return self |
||
865 | * @param \MetadataV4\edm\Annotation $annotation |
||
866 | */ |
||
867 | public function addToNull(\MetadataV4\edm\Annotation $annotation) |
||
872 | |||
873 | /** |
||
874 | * isset null |
||
875 | * |
||
876 | * @param scalar $index |
||
877 | * @return boolean |
||
878 | */ |
||
879 | public function issetNull($index) |
||
883 | |||
884 | /** |
||
885 | * unset null |
||
886 | * |
||
887 | * @param scalar $index |
||
888 | * @return void |
||
889 | */ |
||
890 | public function unsetNull($index) |
||
894 | |||
895 | /** |
||
896 | * Gets as null |
||
897 | * |
||
898 | * @return \MetadataV4\edm\Annotation[] |
||
899 | */ |
||
900 | public function getNull() |
||
904 | |||
905 | /** |
||
906 | * Sets a new null |
||
907 | * |
||
908 | * @param \MetadataV4\edm\Annotation[] $null |
||
909 | * @return self |
||
910 | */ |
||
911 | public function setNull(array $null) |
||
916 | |||
917 | /** |
||
918 | * Gets as navigationPropertyPath |
||
919 | * |
||
920 | * @return string |
||
921 | */ |
||
922 | public function getNavigationPropertyPath() |
||
926 | |||
927 | /** |
||
928 | * Sets a new navigationPropertyPath |
||
929 | * |
||
930 | * @param string $navigationPropertyPath |
||
931 | * @return self |
||
932 | */ |
||
933 | public function setNavigationPropertyPath($navigationPropertyPath) |
||
938 | |||
939 | /** |
||
940 | * Gets as path |
||
941 | * |
||
942 | * @return string |
||
943 | */ |
||
944 | public function getPath() |
||
948 | |||
949 | /** |
||
950 | * Sets a new path |
||
951 | * |
||
952 | * @param string $path |
||
953 | * @return self |
||
954 | */ |
||
955 | public function setPath($path) |
||
960 | |||
961 | /** |
||
962 | * Gets as propertyPath |
||
963 | * |
||
964 | * @return string |
||
965 | */ |
||
966 | public function getPropertyPath() |
||
970 | |||
971 | /** |
||
972 | * Sets a new propertyPath |
||
973 | * |
||
974 | * @param string $propertyPath |
||
975 | * @return self |
||
976 | */ |
||
977 | public function setPropertyPath($propertyPath) |
||
982 | |||
983 | /** |
||
984 | * Gets as record |
||
985 | * |
||
986 | * @return \MetadataV4\edm\TRecordExpressionType |
||
987 | */ |
||
988 | public function getRecord() |
||
992 | |||
993 | /** |
||
994 | * Sets a new record |
||
995 | * |
||
996 | * @param \MetadataV4\edm\TRecordExpressionType $record |
||
997 | * @return self |
||
998 | */ |
||
999 | public function setRecord(\MetadataV4\edm\TRecordExpressionType $record) |
||
1004 | |||
1005 | /** |
||
1006 | * Gets as urlRef |
||
1007 | * |
||
1008 | * @return \MetadataV4\edm\TOneChildExpressionType |
||
1009 | */ |
||
1010 | public function getUrlRef() |
||
1014 | |||
1015 | /** |
||
1016 | * Sets a new urlRef |
||
1017 | * |
||
1018 | * @param \MetadataV4\edm\TOneChildExpressionType $urlRef |
||
1019 | * @return self |
||
1020 | */ |
||
1021 | public function setUrlRef(\MetadataV4\edm\TOneChildExpressionType $urlRef) |
||
1026 | } |
||
1027 |