Complex classes like CreateMeetingParameters 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 CreateMeetingParameters, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
24 | class CreateMeetingParameters extends MetaParameters |
||
25 | { |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | private $meetingId; |
||
30 | |||
31 | /** |
||
32 | * @var string |
||
33 | */ |
||
34 | private $meetingName; |
||
35 | |||
36 | /** |
||
37 | * @var string |
||
38 | */ |
||
39 | private $attendeePassword; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | */ |
||
44 | private $moderatorPassword; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | private $dialNumber; |
||
50 | |||
51 | /** |
||
52 | * @var int |
||
53 | */ |
||
54 | private $voiceBridge; |
||
55 | |||
56 | /** |
||
57 | * @var string |
||
58 | */ |
||
59 | private $webVoice; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | private $logoutUrl; |
||
65 | |||
66 | /** |
||
67 | * @var int |
||
68 | */ |
||
69 | private $maxParticipants; |
||
70 | |||
71 | /** |
||
72 | * @var bool |
||
73 | */ |
||
74 | private $record; |
||
75 | |||
76 | /** |
||
77 | * @var bool |
||
78 | */ |
||
79 | private $autoStartRecording; |
||
80 | |||
81 | /** |
||
82 | * @var bool |
||
83 | */ |
||
84 | private $allowStartStopRecording; |
||
85 | |||
86 | /** |
||
87 | * @var int |
||
88 | */ |
||
89 | private $duration; |
||
90 | |||
91 | /** |
||
92 | * @var string |
||
93 | */ |
||
94 | private $welcomeMessage; |
||
95 | |||
96 | /** |
||
97 | * @var string |
||
98 | */ |
||
99 | private $moderatorOnlyMessage; |
||
100 | |||
101 | /** |
||
102 | * @var bool |
||
103 | */ |
||
104 | private $webcamsOnlyForModerator; |
||
105 | |||
106 | /** |
||
107 | * @var string |
||
108 | */ |
||
109 | private $logo; |
||
110 | |||
111 | /** |
||
112 | * @var string |
||
113 | */ |
||
114 | private $copyright; |
||
115 | |||
116 | /** |
||
117 | * @var bool |
||
118 | */ |
||
119 | private $muteOnStart; |
||
120 | |||
121 | /** |
||
122 | * @var bool |
||
123 | */ |
||
124 | private $lockSettingsDisableCam; |
||
125 | |||
126 | /** |
||
127 | * @var bool |
||
128 | */ |
||
129 | private $lockSettingsDisableMic; |
||
130 | |||
131 | /** |
||
132 | * @var bool |
||
133 | */ |
||
134 | private $lockSettingsDisablePrivateChat; |
||
135 | |||
136 | /** |
||
137 | * @var bool |
||
138 | */ |
||
139 | private $lockSettingsDisablePublicChat; |
||
140 | |||
141 | /** |
||
142 | * @var bool |
||
143 | */ |
||
144 | private $lockSettingsDisableNote; |
||
145 | |||
146 | /** |
||
147 | * @var bool |
||
148 | */ |
||
149 | private $lockSettingsHideUserList; |
||
150 | |||
151 | /** |
||
152 | * @var bool |
||
153 | */ |
||
154 | private $lockSettingsLockedLayout; |
||
155 | |||
156 | /** |
||
157 | * @var bool |
||
158 | */ |
||
159 | private $lockSettingsLockOnJoin = true; |
||
160 | |||
161 | /** |
||
162 | * @var bool |
||
163 | */ |
||
164 | private $lockSettingsLockOnJoinConfigurable; |
||
165 | |||
166 | /** |
||
167 | * @var array |
||
168 | */ |
||
169 | private $presentations = []; |
||
170 | |||
171 | /** |
||
172 | * @var boolean |
||
173 | */ |
||
174 | private $isBreakout; |
||
175 | |||
176 | /** |
||
177 | * @var string |
||
178 | */ |
||
179 | private $parentMeetingId; |
||
180 | |||
181 | /** |
||
182 | * @var int |
||
183 | */ |
||
184 | private $sequence; |
||
185 | |||
186 | /** |
||
187 | * @var boolean |
||
188 | */ |
||
189 | private $freeJoin; |
||
190 | |||
191 | /** |
||
192 | * CreateMeetingParameters constructor. |
||
193 | * |
||
194 | * @param $meetingId |
||
195 | * @param $meetingName |
||
196 | */ |
||
197 | public function __construct($meetingId, $meetingName) |
||
202 | |||
203 | /** |
||
204 | * @return string |
||
205 | */ |
||
206 | public function getMeetingId() |
||
210 | |||
211 | /** |
||
212 | * @param string $meetingId |
||
213 | * |
||
214 | * @return CreateMeetingParameters |
||
215 | */ |
||
216 | public function setMeetingId($meetingId) |
||
222 | |||
223 | /** |
||
224 | * @return string |
||
225 | */ |
||
226 | public function getMeetingName() |
||
230 | |||
231 | /** |
||
232 | * @param string $meetingName |
||
233 | * |
||
234 | * @return CreateMeetingParameters |
||
235 | */ |
||
236 | public function setMeetingName($meetingName) |
||
242 | |||
243 | /** |
||
244 | * @return string |
||
245 | */ |
||
246 | public function getAttendeePassword() |
||
250 | |||
251 | /** |
||
252 | * @param string $attendeePassword |
||
253 | * |
||
254 | * @return CreateMeetingParameters |
||
255 | */ |
||
256 | public function setAttendeePassword($attendeePassword) |
||
262 | |||
263 | /** |
||
264 | * @return string |
||
265 | */ |
||
266 | public function getModeratorPassword() |
||
270 | |||
271 | /** |
||
272 | * @param string $moderatorPassword |
||
273 | * |
||
274 | * @return CreateMeetingParameters |
||
275 | */ |
||
276 | public function setModeratorPassword($moderatorPassword) |
||
282 | |||
283 | /** |
||
284 | * @return string |
||
285 | */ |
||
286 | public function getDialNumber() |
||
290 | |||
291 | /** |
||
292 | * @param string $dialNumber |
||
293 | * |
||
294 | * @return CreateMeetingParameters |
||
295 | */ |
||
296 | public function setDialNumber($dialNumber) |
||
302 | |||
303 | /** |
||
304 | * @return int |
||
305 | */ |
||
306 | public function getVoiceBridge() |
||
310 | |||
311 | /** |
||
312 | * @param int $voiceBridge |
||
313 | * |
||
314 | * @return CreateMeetingParameters |
||
315 | */ |
||
316 | public function setVoiceBridge($voiceBridge) |
||
322 | |||
323 | /** |
||
324 | * @return string |
||
325 | */ |
||
326 | public function getWebVoice() |
||
330 | |||
331 | /** |
||
332 | * @param string $webVoice |
||
333 | * |
||
334 | * @return CreateMeetingParameters |
||
335 | */ |
||
336 | public function setWebVoice($webVoice) |
||
342 | |||
343 | /** |
||
344 | * @return string |
||
345 | */ |
||
346 | public function getLogoutUrl() |
||
350 | |||
351 | /** |
||
352 | * @param string $logoutUrl |
||
353 | * |
||
354 | * @return CreateMeetingParameters |
||
355 | */ |
||
356 | public function setLogoutUrl($logoutUrl) |
||
362 | |||
363 | /** |
||
364 | * @return int |
||
365 | */ |
||
366 | public function getMaxParticipants() |
||
370 | |||
371 | /** |
||
372 | * @param int $maxParticipants |
||
373 | * |
||
374 | * @return CreateMeetingParameters |
||
375 | */ |
||
376 | public function setMaxParticipants($maxParticipants) |
||
382 | |||
383 | /** |
||
384 | * @return bool |
||
385 | */ |
||
386 | public function isRecorded() |
||
390 | |||
391 | /** |
||
392 | * @param bool $record |
||
393 | * |
||
394 | * @return CreateMeetingParameters |
||
395 | */ |
||
396 | public function setRecord($record) |
||
402 | |||
403 | /** |
||
404 | * @return bool |
||
405 | */ |
||
406 | public function isAutoStartRecording() |
||
410 | |||
411 | /** |
||
412 | * @param bool $autoStartRecording |
||
413 | * |
||
414 | * @return CreateMeetingParameters |
||
415 | */ |
||
416 | public function setAutoStartRecording($autoStartRecording) |
||
422 | |||
423 | /** |
||
424 | * @return bool |
||
425 | */ |
||
426 | public function isAllowStartStopRecording() |
||
430 | |||
431 | /** |
||
432 | * @param bool $allowStartStopRecording |
||
433 | * |
||
434 | * @return CreateMeetingParameters |
||
435 | */ |
||
436 | public function setAllowStartStopRecording($allowStartStopRecording) |
||
442 | |||
443 | /** |
||
444 | * @return int |
||
445 | */ |
||
446 | public function getDuration() |
||
450 | |||
451 | /** |
||
452 | * @param int $duration |
||
453 | * |
||
454 | * @return CreateMeetingParameters |
||
455 | */ |
||
456 | public function setDuration($duration) |
||
462 | |||
463 | /** |
||
464 | * @return string |
||
465 | */ |
||
466 | public function getWelcomeMessage() |
||
470 | |||
471 | /** |
||
472 | * @param string $welcomeMessage |
||
473 | * |
||
474 | * @return CreateMeetingParameters |
||
475 | */ |
||
476 | public function setWelcomeMessage($welcomeMessage) |
||
482 | |||
483 | /** |
||
484 | * @return string |
||
485 | */ |
||
486 | public function getModeratorOnlyMessage() |
||
490 | |||
491 | /** |
||
492 | * @param string $message |
||
493 | * |
||
494 | * @return CreateMeetingParameters |
||
495 | */ |
||
496 | public function setModeratorOnlyMessage($message) |
||
502 | |||
503 | /** |
||
504 | * @return bool |
||
505 | */ |
||
506 | public function isWebcamsOnlyForModerator() |
||
510 | |||
511 | /** |
||
512 | * @param bool $webcamsOnlyForModerator |
||
513 | * @return CreateMeetingParameters |
||
514 | */ |
||
515 | public function setWebcamsOnlyForModerator($webcamsOnlyForModerator) |
||
521 | |||
522 | /** |
||
523 | * @return string |
||
524 | */ |
||
525 | public function getLogo() |
||
529 | |||
530 | /** |
||
531 | * @param string $logo |
||
532 | * @return CreateMeetingParameters |
||
533 | */ |
||
534 | public function setLogo($logo) |
||
540 | |||
541 | /** |
||
542 | * @return string |
||
543 | */ |
||
544 | public function getCopyright() |
||
548 | |||
549 | /** |
||
550 | * @param string $copyright |
||
551 | * @return CreateMeetingParameters |
||
552 | */ |
||
553 | public function setCopyright($copyright) |
||
559 | |||
560 | /** |
||
561 | * @return bool |
||
562 | */ |
||
563 | public function isMuteOnStart() |
||
567 | |||
568 | /** |
||
569 | * @param bool $muteOnStart |
||
570 | * @return CreateMeetingParameters |
||
571 | */ |
||
572 | public function setMuteOnStart($muteOnStart) |
||
578 | |||
579 | /** |
||
580 | * @return bool |
||
581 | */ |
||
582 | public function isLockSettingsDisableCam() |
||
586 | |||
587 | /** |
||
588 | * @param bool $lockSettingsDisableCam |
||
589 | * @return CreateMeetingParameters |
||
590 | */ |
||
591 | public function setLockSettingsDisableCam($lockSettingsDisableCam) |
||
597 | |||
598 | /** |
||
599 | * @return bool |
||
600 | */ |
||
601 | public function isLockSettingsDisableMic() |
||
605 | |||
606 | /** |
||
607 | * @param bool $lockSettingsDisableMic |
||
608 | * @return CreateMeetingParameters |
||
609 | */ |
||
610 | public function setLockSettingsDisableMic($lockSettingsDisableMic) |
||
616 | |||
617 | /** |
||
618 | * @return bool |
||
619 | */ |
||
620 | public function isLockSettingsDisablePrivateChat() |
||
624 | |||
625 | /** |
||
626 | * @param bool $lockSettingsDisablePrivateChat |
||
627 | * @return CreateMeetingParameters |
||
628 | */ |
||
629 | public function setLockSettingsDisablePrivateChat($lockSettingsDisablePrivateChat) |
||
635 | |||
636 | /** |
||
637 | * @return bool |
||
638 | */ |
||
639 | public function isLockSettingsDisablePublicChat() |
||
643 | |||
644 | /** |
||
645 | * @param bool $lockSettingsDisablePublicChat |
||
646 | * @return CreateMeetingParameters |
||
647 | */ |
||
648 | public function setLockSettingsDisablePublicChat($lockSettingsDisablePublicChat) |
||
654 | |||
655 | /** |
||
656 | * @return bool |
||
657 | */ |
||
658 | public function isLockSettingsDisableNote() |
||
662 | |||
663 | /** |
||
664 | * @param bool $lockSettingsDisableNote |
||
665 | * @return CreateMeetingParameters |
||
666 | */ |
||
667 | public function setLockSettingsDisableNote($lockSettingsDisableNote) |
||
673 | |||
674 | /** |
||
675 | * @return bool |
||
676 | */ |
||
677 | public function isLockSettingsHideUserList() |
||
681 | |||
682 | /** |
||
683 | * @param bool $lockSettingsHideUserList |
||
684 | * @return CreateMeetingParameters |
||
685 | */ |
||
686 | public function setLockSettingsHideUserList($lockSettingsHideUserList) |
||
692 | |||
693 | /** |
||
694 | * @return bool |
||
695 | */ |
||
696 | public function isLockSettingsLockedLayout() |
||
700 | |||
701 | /** |
||
702 | * @param bool $lockSettingsLockedLayout |
||
703 | * @return CreateMeetingParameters |
||
704 | */ |
||
705 | public function setLockSettingsLockedLayout($lockSettingsLockedLayout) |
||
711 | |||
712 | /** |
||
713 | * @return bool |
||
714 | */ |
||
715 | public function isLockSettingsLockOnJoin() |
||
719 | |||
720 | /** |
||
721 | * @param bool $lockOnJoin |
||
722 | * @return CreateMeetingParameters |
||
723 | */ |
||
724 | public function setLockSettingsLockOnJoin($lockOnJoin) |
||
730 | |||
731 | /** |
||
732 | * @return bool |
||
733 | */ |
||
734 | public function isLockSettingsLockOnJoinConfigurable() |
||
738 | |||
739 | /** |
||
740 | * @param bool $lockOnJoinConfigurable |
||
741 | * @return CreateMeetingParameters |
||
742 | */ |
||
743 | public function setLockSettingsLockOnJoinConfigurable($lockOnJoinConfigurable) |
||
749 | |||
750 | /** |
||
751 | * @param $endCallbackUrl |
||
752 | * @return CreateMeetingParameters |
||
753 | */ |
||
754 | public function setEndCallbackUrl($endCallbackUrl) |
||
760 | |||
761 | /** |
||
762 | * @return bool |
||
763 | */ |
||
764 | public function isBreakout() |
||
768 | |||
769 | /** |
||
770 | * @param bool $isBreakout |
||
771 | * @return CreateMeetingParameters |
||
772 | */ |
||
773 | public function setBreakout($isBreakout) |
||
779 | |||
780 | /** |
||
781 | * @return string |
||
782 | */ |
||
783 | public function getParentMeetingId() |
||
787 | |||
788 | /** |
||
789 | * @param string $parentMeetingId |
||
790 | * @return CreateMeetingParameters |
||
791 | */ |
||
792 | public function setParentMeetingId($parentMeetingId) |
||
798 | |||
799 | /** |
||
800 | * @return int |
||
801 | */ |
||
802 | public function getSequence() |
||
806 | |||
807 | /** |
||
808 | * @param int $sequence |
||
809 | * @return CreateMeetingParameters |
||
810 | */ |
||
811 | public function setSequence($sequence) |
||
817 | |||
818 | /** |
||
819 | * @return bool |
||
820 | */ |
||
821 | public function isFreeJoin() |
||
825 | |||
826 | /** |
||
827 | * @param bool $freeJoin |
||
828 | * @return CreateMeetingParameters |
||
829 | */ |
||
830 | public function setFreeJoin($freeJoin) |
||
836 | |||
837 | /** |
||
838 | * @return array |
||
839 | */ |
||
840 | public function getPresentations() |
||
844 | |||
845 | /** |
||
846 | * @param $nameOrUrl |
||
847 | * @param null $content |
||
848 | * @param null $filename |
||
849 | * |
||
850 | * @return CreateMeetingParameters |
||
851 | */ |
||
852 | public function addPresentation($nameOrUrl, $content = null, $filename = null) |
||
862 | |||
863 | /** |
||
864 | * @return mixed |
||
865 | */ |
||
866 | public function getPresentationsAsXML() |
||
893 | |||
894 | /** |
||
895 | * @return string |
||
896 | */ |
||
897 | public function getHTTPQuery() |
||
942 | } |
||
943 |