Total Complexity | 59 |
Total Lines | 685 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Complex classes like DescribeQuickActionResult 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 DescribeQuickActionResult, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
5 | class DescribeQuickActionResult |
||
6 | { |
||
7 | /** |
||
8 | * @var ShareAccessLevel |
||
9 | */ |
||
10 | protected $accessLevelRequired = null; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $actionEnumOrId = null; |
||
16 | |||
17 | /** |
||
18 | * @var ID |
||
19 | */ |
||
20 | protected $canvasApplicationId = null; |
||
21 | |||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | protected $canvasApplicationName = null; |
||
26 | |||
27 | /** |
||
28 | * @var DescribeColor[] |
||
29 | */ |
||
30 | protected $colors = null; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $contextSobjectType = null; |
||
36 | |||
37 | /** |
||
38 | * @var DescribeQuickActionDefaultValue[] |
||
39 | */ |
||
40 | protected $defaultValues = null; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $flowDevName = null; |
||
46 | |||
47 | /** |
||
48 | * @var string |
||
49 | */ |
||
50 | protected $flowRecordIdVar = null; |
||
51 | |||
52 | /** |
||
53 | * @var int |
||
54 | */ |
||
55 | protected $height = null; |
||
56 | |||
57 | /** |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $iconName = null; |
||
61 | |||
62 | /** |
||
63 | * @var string |
||
64 | */ |
||
65 | protected $iconUrl = null; |
||
66 | |||
67 | /** |
||
68 | * @var DescribeIcon[] |
||
69 | */ |
||
70 | protected $icons = null; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | protected $label = null; |
||
76 | |||
77 | /** |
||
78 | * @var DescribeLayoutSection |
||
79 | */ |
||
80 | protected $layout = null; |
||
81 | |||
82 | /** |
||
83 | * @var ID |
||
84 | */ |
||
85 | protected $lightningComponentBundleId = null; |
||
86 | |||
87 | /** |
||
88 | * @var string |
||
89 | */ |
||
90 | protected $lightningComponentBundleName = null; |
||
91 | |||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | protected $lightningComponentQualifiedName = null; |
||
96 | |||
97 | /** |
||
98 | * @var string |
||
99 | */ |
||
100 | protected $miniIconUrl = null; |
||
101 | |||
102 | /** |
||
103 | * @var string |
||
104 | */ |
||
105 | protected $name = null; |
||
106 | |||
107 | /** |
||
108 | * @var boolean |
||
109 | */ |
||
110 | protected $showQuickActionLcHeader = null; |
||
111 | |||
112 | /** |
||
113 | * @var boolean |
||
114 | */ |
||
115 | protected $showQuickActionVfHeader = null; |
||
116 | |||
117 | /** |
||
118 | * @var string |
||
119 | */ |
||
120 | protected $targetParentField = null; |
||
121 | |||
122 | /** |
||
123 | * @var ID |
||
124 | */ |
||
125 | protected $targetRecordTypeId = null; |
||
126 | |||
127 | /** |
||
128 | * @var string |
||
129 | */ |
||
130 | protected $targetSobjectType = null; |
||
131 | |||
132 | /** |
||
133 | * @var string |
||
134 | */ |
||
135 | protected $type = null; |
||
136 | |||
137 | /** |
||
138 | * @var string |
||
139 | */ |
||
140 | protected $visualforcePageName = null; |
||
141 | |||
142 | /** |
||
143 | * @var string |
||
144 | */ |
||
145 | protected $visualforcePageUrl = null; |
||
146 | |||
147 | /** |
||
148 | * @var int |
||
149 | */ |
||
150 | protected $width = null; |
||
151 | |||
152 | /** |
||
153 | * @param string $actionEnumOrId |
||
154 | * @param string $label |
||
155 | * @param string $name |
||
156 | * @param boolean $showQuickActionLcHeader |
||
157 | * @param boolean $showQuickActionVfHeader |
||
158 | * @param string $type |
||
159 | */ |
||
160 | public function __construct($actionEnumOrId = null, $label = null, $name = null, $showQuickActionLcHeader = null, $showQuickActionVfHeader = null, $type = null) |
||
161 | { |
||
162 | $this->actionEnumOrId = $actionEnumOrId; |
||
163 | $this->label = $label; |
||
164 | $this->name = $name; |
||
165 | $this->showQuickActionLcHeader = $showQuickActionLcHeader; |
||
166 | $this->showQuickActionVfHeader = $showQuickActionVfHeader; |
||
167 | $this->type = $type; |
||
168 | } |
||
169 | |||
170 | /** |
||
171 | * @return ShareAccessLevel |
||
172 | */ |
||
173 | public function getAccessLevelRequired() |
||
174 | { |
||
175 | return $this->accessLevelRequired; |
||
176 | } |
||
177 | |||
178 | /** |
||
179 | * @param ShareAccessLevel $accessLevelRequired |
||
180 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
181 | */ |
||
182 | public function setAccessLevelRequired($accessLevelRequired) |
||
183 | { |
||
184 | $this->accessLevelRequired = $accessLevelRequired; |
||
185 | return $this; |
||
186 | } |
||
187 | |||
188 | /** |
||
189 | * @return string |
||
190 | */ |
||
191 | public function getActionEnumOrId() |
||
192 | { |
||
193 | return $this->actionEnumOrId; |
||
194 | } |
||
195 | |||
196 | /** |
||
197 | * @param string $actionEnumOrId |
||
198 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
199 | */ |
||
200 | public function setActionEnumOrId($actionEnumOrId) |
||
201 | { |
||
202 | $this->actionEnumOrId = $actionEnumOrId; |
||
203 | return $this; |
||
204 | } |
||
205 | |||
206 | /** |
||
207 | * @return ID |
||
208 | */ |
||
209 | public function getCanvasApplicationId() |
||
210 | { |
||
211 | return $this->canvasApplicationId; |
||
212 | } |
||
213 | |||
214 | /** |
||
215 | * @param ID $canvasApplicationId |
||
216 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
217 | */ |
||
218 | public function setCanvasApplicationId($canvasApplicationId) |
||
219 | { |
||
220 | $this->canvasApplicationId = $canvasApplicationId; |
||
221 | return $this; |
||
222 | } |
||
223 | |||
224 | /** |
||
225 | * @return string |
||
226 | */ |
||
227 | public function getCanvasApplicationName() |
||
228 | { |
||
229 | return $this->canvasApplicationName; |
||
230 | } |
||
231 | |||
232 | /** |
||
233 | * @param string $canvasApplicationName |
||
234 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
235 | */ |
||
236 | public function setCanvasApplicationName($canvasApplicationName) |
||
237 | { |
||
238 | $this->canvasApplicationName = $canvasApplicationName; |
||
239 | return $this; |
||
240 | } |
||
241 | |||
242 | /** |
||
243 | * @return DescribeColor[] |
||
244 | */ |
||
245 | public function getColors() |
||
246 | { |
||
247 | return $this->colors; |
||
248 | } |
||
249 | |||
250 | /** |
||
251 | * @param DescribeColor[] $colors |
||
252 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
253 | */ |
||
254 | public function setColors(array $colors = null) |
||
255 | { |
||
256 | $this->colors = $colors; |
||
257 | return $this; |
||
258 | } |
||
259 | |||
260 | /** |
||
261 | * @return string |
||
262 | */ |
||
263 | public function getContextSobjectType() |
||
264 | { |
||
265 | return $this->contextSobjectType; |
||
266 | } |
||
267 | |||
268 | /** |
||
269 | * @param string $contextSobjectType |
||
270 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
271 | */ |
||
272 | public function setContextSobjectType($contextSobjectType) |
||
273 | { |
||
274 | $this->contextSobjectType = $contextSobjectType; |
||
275 | return $this; |
||
276 | } |
||
277 | |||
278 | /** |
||
279 | * @return DescribeQuickActionDefaultValue[] |
||
280 | */ |
||
281 | public function getDefaultValues() |
||
282 | { |
||
283 | return $this->defaultValues; |
||
284 | } |
||
285 | |||
286 | /** |
||
287 | * @param DescribeQuickActionDefaultValue[] $defaultValues |
||
288 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
289 | */ |
||
290 | public function setDefaultValues(array $defaultValues = null) |
||
291 | { |
||
292 | $this->defaultValues = $defaultValues; |
||
293 | return $this; |
||
294 | } |
||
295 | |||
296 | /** |
||
297 | * @return string |
||
298 | */ |
||
299 | public function getFlowDevName() |
||
300 | { |
||
301 | return $this->flowDevName; |
||
302 | } |
||
303 | |||
304 | /** |
||
305 | * @param string $flowDevName |
||
306 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
307 | */ |
||
308 | public function setFlowDevName($flowDevName) |
||
309 | { |
||
310 | $this->flowDevName = $flowDevName; |
||
311 | return $this; |
||
312 | } |
||
313 | |||
314 | /** |
||
315 | * @return string |
||
316 | */ |
||
317 | public function getFlowRecordIdVar() |
||
318 | { |
||
319 | return $this->flowRecordIdVar; |
||
320 | } |
||
321 | |||
322 | /** |
||
323 | * @param string $flowRecordIdVar |
||
324 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
325 | */ |
||
326 | public function setFlowRecordIdVar($flowRecordIdVar) |
||
327 | { |
||
328 | $this->flowRecordIdVar = $flowRecordIdVar; |
||
329 | return $this; |
||
330 | } |
||
331 | |||
332 | /** |
||
333 | * @return int |
||
334 | */ |
||
335 | public function getHeight() |
||
336 | { |
||
337 | return $this->height; |
||
338 | } |
||
339 | |||
340 | /** |
||
341 | * @param int $height |
||
342 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
343 | */ |
||
344 | public function setHeight($height) |
||
345 | { |
||
346 | $this->height = $height; |
||
347 | return $this; |
||
348 | } |
||
349 | |||
350 | /** |
||
351 | * @return string |
||
352 | */ |
||
353 | public function getIconName() |
||
354 | { |
||
355 | return $this->iconName; |
||
356 | } |
||
357 | |||
358 | /** |
||
359 | * @param string $iconName |
||
360 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
361 | */ |
||
362 | public function setIconName($iconName) |
||
363 | { |
||
364 | $this->iconName = $iconName; |
||
365 | return $this; |
||
366 | } |
||
367 | |||
368 | /** |
||
369 | * @return string |
||
370 | */ |
||
371 | public function getIconUrl() |
||
372 | { |
||
373 | return $this->iconUrl; |
||
374 | } |
||
375 | |||
376 | /** |
||
377 | * @param string $iconUrl |
||
378 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
379 | */ |
||
380 | public function setIconUrl($iconUrl) |
||
381 | { |
||
382 | $this->iconUrl = $iconUrl; |
||
383 | return $this; |
||
384 | } |
||
385 | |||
386 | /** |
||
387 | * @return DescribeIcon[] |
||
388 | */ |
||
389 | public function getIcons() |
||
390 | { |
||
391 | return $this->icons; |
||
392 | } |
||
393 | |||
394 | /** |
||
395 | * @param DescribeIcon[] $icons |
||
396 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
397 | */ |
||
398 | public function setIcons(array $icons = null) |
||
399 | { |
||
400 | $this->icons = $icons; |
||
401 | return $this; |
||
402 | } |
||
403 | |||
404 | /** |
||
405 | * @return string |
||
406 | */ |
||
407 | public function getLabel() |
||
408 | { |
||
409 | return $this->label; |
||
410 | } |
||
411 | |||
412 | /** |
||
413 | * @param string $label |
||
414 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
415 | */ |
||
416 | public function setLabel($label) |
||
417 | { |
||
418 | $this->label = $label; |
||
419 | return $this; |
||
420 | } |
||
421 | |||
422 | /** |
||
423 | * @return DescribeLayoutSection |
||
424 | */ |
||
425 | public function getLayout() |
||
426 | { |
||
427 | return $this->layout; |
||
428 | } |
||
429 | |||
430 | /** |
||
431 | * @param DescribeLayoutSection $layout |
||
432 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
433 | */ |
||
434 | public function setLayout($layout) |
||
435 | { |
||
436 | $this->layout = $layout; |
||
437 | return $this; |
||
438 | } |
||
439 | |||
440 | /** |
||
441 | * @return ID |
||
442 | */ |
||
443 | public function getLightningComponentBundleId() |
||
444 | { |
||
445 | return $this->lightningComponentBundleId; |
||
446 | } |
||
447 | |||
448 | /** |
||
449 | * @param ID $lightningComponentBundleId |
||
450 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
451 | */ |
||
452 | public function setLightningComponentBundleId($lightningComponentBundleId) |
||
453 | { |
||
454 | $this->lightningComponentBundleId = $lightningComponentBundleId; |
||
455 | return $this; |
||
456 | } |
||
457 | |||
458 | /** |
||
459 | * @return string |
||
460 | */ |
||
461 | public function getLightningComponentBundleName() |
||
462 | { |
||
463 | return $this->lightningComponentBundleName; |
||
464 | } |
||
465 | |||
466 | /** |
||
467 | * @param string $lightningComponentBundleName |
||
468 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
469 | */ |
||
470 | public function setLightningComponentBundleName($lightningComponentBundleName) |
||
474 | } |
||
475 | |||
476 | /** |
||
477 | * @return string |
||
478 | */ |
||
479 | public function getLightningComponentQualifiedName() |
||
480 | { |
||
481 | return $this->lightningComponentQualifiedName; |
||
482 | } |
||
483 | |||
484 | /** |
||
485 | * @param string $lightningComponentQualifiedName |
||
486 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
487 | */ |
||
488 | public function setLightningComponentQualifiedName($lightningComponentQualifiedName) |
||
489 | { |
||
490 | $this->lightningComponentQualifiedName = $lightningComponentQualifiedName; |
||
491 | return $this; |
||
492 | } |
||
493 | |||
494 | /** |
||
495 | * @return string |
||
496 | */ |
||
497 | public function getMiniIconUrl() |
||
498 | { |
||
499 | return $this->miniIconUrl; |
||
500 | } |
||
501 | |||
502 | /** |
||
503 | * @param string $miniIconUrl |
||
504 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
505 | */ |
||
506 | public function setMiniIconUrl($miniIconUrl) |
||
507 | { |
||
508 | $this->miniIconUrl = $miniIconUrl; |
||
509 | return $this; |
||
510 | } |
||
511 | |||
512 | /** |
||
513 | * @return string |
||
514 | */ |
||
515 | public function getName() |
||
516 | { |
||
517 | return $this->name; |
||
518 | } |
||
519 | |||
520 | /** |
||
521 | * @param string $name |
||
522 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
523 | */ |
||
524 | public function setName($name) |
||
525 | { |
||
526 | $this->name = $name; |
||
527 | return $this; |
||
528 | } |
||
529 | |||
530 | /** |
||
531 | * @return boolean |
||
532 | */ |
||
533 | public function getShowQuickActionLcHeader() |
||
534 | { |
||
535 | return $this->showQuickActionLcHeader; |
||
536 | } |
||
537 | |||
538 | /** |
||
539 | * @param boolean $showQuickActionLcHeader |
||
540 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
541 | */ |
||
542 | public function setShowQuickActionLcHeader($showQuickActionLcHeader) |
||
543 | { |
||
544 | $this->showQuickActionLcHeader = $showQuickActionLcHeader; |
||
545 | return $this; |
||
546 | } |
||
547 | |||
548 | /** |
||
549 | * @return boolean |
||
550 | */ |
||
551 | public function getShowQuickActionVfHeader() |
||
554 | } |
||
555 | |||
556 | /** |
||
557 | * @param boolean $showQuickActionVfHeader |
||
558 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
559 | */ |
||
560 | public function setShowQuickActionVfHeader($showQuickActionVfHeader) |
||
561 | { |
||
562 | $this->showQuickActionVfHeader = $showQuickActionVfHeader; |
||
563 | return $this; |
||
564 | } |
||
565 | |||
566 | /** |
||
567 | * @return string |
||
568 | */ |
||
569 | public function getTargetParentField() |
||
570 | { |
||
571 | return $this->targetParentField; |
||
572 | } |
||
573 | |||
574 | /** |
||
575 | * @param string $targetParentField |
||
576 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
577 | */ |
||
578 | public function setTargetParentField($targetParentField) |
||
579 | { |
||
580 | $this->targetParentField = $targetParentField; |
||
581 | return $this; |
||
582 | } |
||
583 | |||
584 | /** |
||
585 | * @return ID |
||
586 | */ |
||
587 | public function getTargetRecordTypeId() |
||
588 | { |
||
589 | return $this->targetRecordTypeId; |
||
590 | } |
||
591 | |||
592 | /** |
||
593 | * @param ID $targetRecordTypeId |
||
594 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
595 | */ |
||
596 | public function setTargetRecordTypeId($targetRecordTypeId) |
||
597 | { |
||
598 | $this->targetRecordTypeId = $targetRecordTypeId; |
||
599 | return $this; |
||
600 | } |
||
601 | |||
602 | /** |
||
603 | * @return string |
||
604 | */ |
||
605 | public function getTargetSobjectType() |
||
606 | { |
||
607 | return $this->targetSobjectType; |
||
608 | } |
||
609 | |||
610 | /** |
||
611 | * @param string $targetSobjectType |
||
612 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
613 | */ |
||
614 | public function setTargetSobjectType($targetSobjectType) |
||
615 | { |
||
616 | $this->targetSobjectType = $targetSobjectType; |
||
617 | return $this; |
||
618 | } |
||
619 | |||
620 | /** |
||
621 | * @return string |
||
622 | */ |
||
623 | public function getType() |
||
626 | } |
||
627 | |||
628 | /** |
||
629 | * @param string $type |
||
630 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
631 | */ |
||
632 | public function setType($type) |
||
633 | { |
||
634 | $this->type = $type; |
||
635 | return $this; |
||
636 | } |
||
637 | |||
638 | /** |
||
639 | * @return string |
||
640 | */ |
||
641 | public function getVisualforcePageName() |
||
642 | { |
||
643 | return $this->visualforcePageName; |
||
644 | } |
||
645 | |||
646 | /** |
||
647 | * @param string $visualforcePageName |
||
648 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
649 | */ |
||
650 | public function setVisualforcePageName($visualforcePageName) |
||
651 | { |
||
652 | $this->visualforcePageName = $visualforcePageName; |
||
653 | return $this; |
||
654 | } |
||
655 | |||
656 | /** |
||
657 | * @return string |
||
658 | */ |
||
659 | public function getVisualforcePageUrl() |
||
662 | } |
||
663 | |||
664 | /** |
||
665 | * @param string $visualforcePageUrl |
||
666 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
667 | */ |
||
668 | public function setVisualforcePageUrl($visualforcePageUrl) |
||
669 | { |
||
670 | $this->visualforcePageUrl = $visualforcePageUrl; |
||
671 | return $this; |
||
672 | } |
||
673 | |||
674 | /** |
||
675 | * @return int |
||
676 | */ |
||
677 | public function getWidth() |
||
678 | { |
||
679 | return $this->width; |
||
680 | } |
||
681 | |||
682 | /** |
||
683 | * @param int $width |
||
684 | * @return \SForce\Wsdl\DescribeQuickActionResult |
||
685 | */ |
||
686 | public function setWidth($width) |
||
687 | { |
||
688 | $this->width = $width; |
||
690 | } |
||
691 | } |
||
692 |