Complex classes like MapperBase 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 MapperBase, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
11 | abstract class MapperBase implements MappingBaseInterface |
||
12 | { |
||
13 | use Regions; |
||
14 | use Languages; |
||
15 | |||
16 | private const ENABLED = true; |
||
17 | |||
18 | private const REGION = 'GB'; |
||
19 | |||
20 | private const LANGUAGE = 'en-gb'; |
||
21 | |||
22 | private const TYPE_ROADMAP = 'ROADMAP'; |
||
23 | private const TYPE_SATELLITE = 'SATELLITE'; |
||
24 | private const TYPE_HYBRID = 'HYBRID'; |
||
25 | private const TYPE_TERRAIN = 'TERRAIN'; |
||
26 | |||
27 | private const ASYNC = false; |
||
28 | |||
29 | private const MARKER = true; |
||
30 | |||
31 | private const CENTER = true; |
||
32 | |||
33 | private const LOCATE = false; |
||
34 | |||
35 | private const ZOOM = 8; |
||
36 | private const SCROLL_WHEEL_ZOOM = true; |
||
37 | |||
38 | private const CONTROL_ZOOM = true; |
||
39 | private const CONTROL_MAP_TYPE = true; |
||
40 | private const CONTROL_SCALE = false; |
||
41 | private const CONTROL_STREET_VIEW = true; |
||
42 | private const CONTROL_ROTATE = false; |
||
43 | private const CONTROL_FULLSCREEN = true; |
||
44 | |||
45 | private const HEADING = 0; |
||
46 | |||
47 | private const TILT = 0; |
||
48 | |||
49 | private const UI = true; |
||
50 | |||
51 | private const ANIMATION_NONE = 'NONE'; |
||
52 | private const ANIMATION_DROP = 'DROP'; |
||
53 | private const ANIMATION_BOUNCE = 'BOUNCE'; |
||
54 | |||
55 | private const GESTURE_HANDLING_AUTO = 'auto'; |
||
56 | private const GESTURE_HANDLING_NONE = 'none'; |
||
57 | private const GESTURE_HANDLING_GREEDY = 'greedy'; |
||
58 | private const GESTURE_HANDLING_COOPERATIVE = 'cooperative'; |
||
59 | |||
60 | private const OVERLAY_NONE = 'NONE'; |
||
61 | private const OVERLAY_BIKE = 'BIKE'; |
||
62 | private const OVERLAY_TRANSIT = 'TRANSIT'; |
||
63 | private const OVERLAY_TRAFFIC = 'TRAFFIC'; |
||
64 | |||
65 | private const SYMBOL_CIRCLE = 'CIRCLE'; |
||
66 | private const SYMBOL_BACKWARD_CLOSED_ARROW = 'BACKWARD_CLOSED_ARROW'; |
||
67 | private const SYMBOL_FORWARD_CLOSED_ARROW = 'FORWARD_CLOSED_ARROW'; |
||
68 | private const SYMBOL_BACKWARD_OPEN_ARROW = 'BACKWARD_OPEN_ARROW'; |
||
69 | private const SYMBOL_FORWARD_OPEN_ARROW = 'FORWARD_OPEN_ARROW'; |
||
70 | |||
71 | private const ICON = ''; |
||
72 | |||
73 | private const CLUSTER = true; |
||
74 | |||
75 | private const CLUSTERS_ICON = '//googlemaps.github.io/js-marker-clusterer/images/m'; |
||
76 | private const CLUSTERS_GRID = 60; |
||
77 | private const CLUSTERS_ZOOM = null; |
||
78 | private const CLUSTERS_CENTER = false; |
||
79 | private const CLUSTERS_SIZE = 2; |
||
80 | |||
81 | /** |
||
82 | * View. |
||
83 | * |
||
84 | * @var \Illuminate\View\Factory |
||
85 | */ |
||
86 | protected $view; |
||
87 | |||
88 | /** |
||
89 | * Mapping enabled. |
||
90 | * |
||
91 | * @var boolean |
||
92 | */ |
||
93 | protected $enabled; |
||
94 | |||
95 | /** |
||
96 | * API Key. |
||
97 | * |
||
98 | * @var string |
||
99 | */ |
||
100 | protected $key; |
||
101 | |||
102 | /** |
||
103 | * API Version. |
||
104 | * |
||
105 | * @var float|string |
||
106 | */ |
||
107 | protected $version; |
||
108 | |||
109 | /** |
||
110 | * API region. |
||
111 | * |
||
112 | * @var string |
||
113 | */ |
||
114 | protected $region; |
||
115 | |||
116 | /** |
||
117 | * API Language. |
||
118 | * |
||
119 | * @var string |
||
120 | */ |
||
121 | protected $language; |
||
122 | |||
123 | /** |
||
124 | * Async maps. |
||
125 | * |
||
126 | * @var boolean |
||
127 | */ |
||
128 | protected $async; |
||
129 | |||
130 | /** |
||
131 | * Automatic map marker. |
||
132 | * |
||
133 | * @var boolean |
||
134 | */ |
||
135 | protected $marker; |
||
136 | |||
137 | /** |
||
138 | * Center map automatically. |
||
139 | * |
||
140 | * @var boolean |
||
141 | */ |
||
142 | protected $center; |
||
143 | |||
144 | /** |
||
145 | * Locate users location. |
||
146 | * |
||
147 | * @var boolean |
||
148 | */ |
||
149 | protected $locate; |
||
150 | |||
151 | /** |
||
152 | * Show map UI. |
||
153 | * |
||
154 | * @var boolean |
||
155 | */ |
||
156 | protected $ui; |
||
157 | |||
158 | /** |
||
159 | * Map zoom level. |
||
160 | * |
||
161 | * @var int |
||
162 | */ |
||
163 | protected $zoom; |
||
164 | |||
165 | /** |
||
166 | * Map scroll wheel zoom. |
||
167 | * |
||
168 | * @var boolean |
||
169 | */ |
||
170 | protected $scrollWheelZoom; |
||
171 | |||
172 | /** |
||
173 | * Map zoom control. |
||
174 | * |
||
175 | * @var boolean |
||
176 | */ |
||
177 | protected $zoomControl; |
||
178 | |||
179 | /** |
||
180 | * Map type control. |
||
181 | * |
||
182 | * @var boolean |
||
183 | */ |
||
184 | protected $mapTypeControl; |
||
185 | |||
186 | /** |
||
187 | * Map scale control. |
||
188 | * |
||
189 | * @var boolean |
||
190 | */ |
||
191 | protected $scaleControl; |
||
192 | |||
193 | /** |
||
194 | * Map street view control. |
||
195 | * |
||
196 | * @var boolean |
||
197 | */ |
||
198 | protected $streetViewControl; |
||
199 | |||
200 | /** |
||
201 | * Map rotate control. |
||
202 | * |
||
203 | * @var boolean |
||
204 | */ |
||
205 | protected $rotateControl; |
||
206 | |||
207 | /** |
||
208 | * Map fullscreen control. |
||
209 | * |
||
210 | * @var boolean |
||
211 | */ |
||
212 | protected $fullscreenControl; |
||
213 | |||
214 | /** |
||
215 | * Map type. |
||
216 | * |
||
217 | * @var string |
||
218 | */ |
||
219 | protected $type; |
||
220 | |||
221 | /** |
||
222 | * Available map types. |
||
223 | * |
||
224 | * @var array |
||
225 | */ |
||
226 | protected $types = [ |
||
227 | 'ROADMAP', |
||
228 | 'SATELLITE', |
||
229 | 'HYBRID', |
||
230 | 'TERRAIN' |
||
231 | ]; |
||
232 | |||
233 | /** |
||
234 | * Map heading. |
||
235 | * |
||
236 | * @var int |
||
237 | */ |
||
238 | protected $heading; |
||
239 | |||
240 | /** |
||
241 | * Map tilt. |
||
242 | * |
||
243 | * @var int |
||
244 | */ |
||
245 | protected $tilt; |
||
246 | |||
247 | /** |
||
248 | * Map marker icon. |
||
249 | * |
||
250 | * @var string |
||
251 | */ |
||
252 | protected $icon; |
||
253 | |||
254 | /** |
||
255 | * Map marker animation. |
||
256 | * |
||
257 | * @var string |
||
258 | */ |
||
259 | protected $animation; |
||
260 | |||
261 | /** |
||
262 | * Available map marker animations. |
||
263 | * |
||
264 | * @var array |
||
265 | */ |
||
266 | protected $animations = [ |
||
267 | 'NONE', |
||
268 | 'DROP', |
||
269 | 'BOUNCE', |
||
270 | ]; |
||
271 | |||
272 | /** |
||
273 | * Gesture handling. |
||
274 | * |
||
275 | * @var string |
||
276 | */ |
||
277 | protected $gestureHandling; |
||
278 | |||
279 | /** |
||
280 | * Available map gesture handlers. |
||
281 | * |
||
282 | * @var array |
||
283 | */ |
||
284 | protected $gestureHandlers = [ |
||
285 | 'auto', |
||
286 | 'none', |
||
287 | 'greedy', |
||
288 | 'cooperative', |
||
289 | ]; |
||
290 | |||
291 | /** |
||
292 | * Map marker cluster. |
||
293 | * |
||
294 | * @var boolean |
||
295 | */ |
||
296 | protected $cluster; |
||
297 | |||
298 | /** |
||
299 | * Map marker clusters icon. |
||
300 | * |
||
301 | * @var string |
||
302 | */ |
||
303 | protected $clustersIcon; |
||
304 | |||
305 | /** |
||
306 | * Map marker clusters grid. |
||
307 | * |
||
308 | * @var int |
||
309 | */ |
||
310 | protected $clustersGrid; |
||
311 | |||
312 | /** |
||
313 | * Map marker clusters zoom. |
||
314 | * |
||
315 | * @var int|null |
||
316 | */ |
||
317 | protected $clustersZoom; |
||
318 | |||
319 | /** |
||
320 | * Map marker clusters center. |
||
321 | * |
||
322 | * @var boolean |
||
323 | */ |
||
324 | protected $clustersCenter; |
||
325 | |||
326 | /** |
||
327 | * Map marker clusters size. |
||
328 | * |
||
329 | * @var int |
||
330 | */ |
||
331 | protected $clustersSize; |
||
332 | |||
333 | /** |
||
334 | * Mapping items. |
||
335 | * |
||
336 | * @var array |
||
337 | */ |
||
338 | public $items = []; |
||
339 | |||
340 | /** |
||
341 | * Construct Googlmapper. |
||
342 | * |
||
343 | * @param View $view |
||
344 | * @param array $options |
||
345 | * |
||
346 | * @throws MapperArgumentException |
||
347 | */ |
||
348 | public function __construct(View $view, array $options = []) |
||
407 | |||
408 | /** |
||
409 | * Is mapping enabled? |
||
410 | * |
||
411 | * @return boolean |
||
412 | */ |
||
413 | public function isEnabled() |
||
417 | |||
418 | /** |
||
419 | * Set enabled status. |
||
420 | * |
||
421 | * @param boolean $value |
||
422 | * |
||
423 | * @throws MapperArgumentException |
||
424 | * |
||
425 | * @return void |
||
426 | */ |
||
427 | protected function setEnabled($value) |
||
435 | |||
436 | /** |
||
437 | * Get the enabled status. |
||
438 | * |
||
439 | * @return boolean |
||
440 | */ |
||
441 | protected function getEnabled() |
||
445 | |||
446 | /** |
||
447 | * Enable mapping. |
||
448 | * |
||
449 | * @throws MapperArgumentException |
||
450 | * |
||
451 | * @return void |
||
452 | */ |
||
453 | public function enableMapping() |
||
457 | |||
458 | /** |
||
459 | * Disable mapping. |
||
460 | * |
||
461 | * @throws MapperArgumentException |
||
462 | * |
||
463 | * @return void |
||
464 | */ |
||
465 | public function disableMapping() |
||
469 | |||
470 | /** |
||
471 | * Set the Google Maps key. |
||
472 | * |
||
473 | * @param string $value |
||
474 | * |
||
475 | * @throws MapperArgumentException |
||
476 | * |
||
477 | * @return void |
||
478 | */ |
||
479 | public function setKey($value) |
||
487 | |||
488 | /** |
||
489 | * Get the Google Maps key. |
||
490 | * |
||
491 | * @return string |
||
492 | */ |
||
493 | public function getKey() |
||
497 | |||
498 | /** |
||
499 | * Set the Google Maps version. |
||
500 | * |
||
501 | * @param float|string $value |
||
502 | * |
||
503 | * @throws MapperArgumentException |
||
504 | * |
||
505 | * @return void |
||
506 | */ |
||
507 | public function setVersion($value) |
||
515 | |||
516 | /** |
||
517 | * Get the Google Maps version. |
||
518 | * |
||
519 | * @return float|string |
||
520 | */ |
||
521 | public function getVersion() |
||
525 | |||
526 | /** |
||
527 | * Set the Google Maps region. |
||
528 | * |
||
529 | * @param string $value |
||
530 | * |
||
531 | * @throws MapperArgumentException |
||
532 | * |
||
533 | * @return void |
||
534 | */ |
||
535 | public function setRegion($value) |
||
547 | |||
548 | /** |
||
549 | * Get the Google Maps region. |
||
550 | * |
||
551 | * @return string |
||
552 | */ |
||
553 | public function getRegion() |
||
557 | |||
558 | /** |
||
559 | * Set the Google Maps language. |
||
560 | * |
||
561 | * @param string $value |
||
562 | * |
||
563 | * @throws MapperArgumentException |
||
564 | * |
||
565 | * @return void |
||
566 | */ |
||
567 | public function setLanguage($value) |
||
579 | |||
580 | /** |
||
581 | * Get the Google Maps language. |
||
582 | * |
||
583 | * @return string |
||
584 | */ |
||
585 | public function getLanguage() |
||
589 | |||
590 | /** |
||
591 | * Set the map async status. |
||
592 | * |
||
593 | * @param boolean $value |
||
594 | * |
||
595 | * @throws MapperArgumentException |
||
596 | * |
||
597 | * @return void |
||
598 | */ |
||
599 | protected function setAsync($value) |
||
607 | |||
608 | /** |
||
609 | * Get the map async status. |
||
610 | * |
||
611 | * @return boolean |
||
612 | */ |
||
613 | public function getAsync() |
||
617 | |||
618 | /** |
||
619 | * Enable async for maps. |
||
620 | * |
||
621 | * @throws MapperArgumentException |
||
622 | * |
||
623 | * @return void |
||
624 | */ |
||
625 | public function enableAsync() |
||
629 | |||
630 | /** |
||
631 | * Disable async for maps. |
||
632 | * |
||
633 | * @throws MapperArgumentException |
||
634 | * |
||
635 | * @return void |
||
636 | */ |
||
637 | public function disableAsync() |
||
641 | |||
642 | /** |
||
643 | * Set the marker status. |
||
644 | * |
||
645 | * @param boolean $value |
||
646 | * |
||
647 | * @throws MapperArgumentException |
||
648 | * |
||
649 | * @return void |
||
650 | */ |
||
651 | protected function setMarker($value) |
||
659 | |||
660 | /** |
||
661 | * Get the marker status. |
||
662 | * |
||
663 | * @return boolean |
||
664 | */ |
||
665 | public function getMarker() |
||
669 | |||
670 | /** |
||
671 | * Enable markers for maps. |
||
672 | * |
||
673 | * @throws MapperArgumentException |
||
674 | * |
||
675 | * @return void |
||
676 | */ |
||
677 | public function enableMarkers() |
||
681 | |||
682 | /** |
||
683 | * Disable markers for maps. |
||
684 | * |
||
685 | * @throws MapperArgumentException |
||
686 | * |
||
687 | * @return void |
||
688 | */ |
||
689 | public function disableMarkers() |
||
693 | |||
694 | /** |
||
695 | * Set the map center status. |
||
696 | * |
||
697 | * @param boolean $value |
||
698 | * |
||
699 | * @throws MapperArgumentException |
||
700 | * |
||
701 | * @return void |
||
702 | */ |
||
703 | protected function setCenter($value) |
||
711 | |||
712 | /** |
||
713 | * Get the map center status. |
||
714 | * |
||
715 | * @return boolean |
||
716 | */ |
||
717 | public function getCenter() |
||
721 | |||
722 | /** |
||
723 | * Enable center of maps. |
||
724 | * |
||
725 | * @throws MapperArgumentException |
||
726 | * |
||
727 | * @return void |
||
728 | */ |
||
729 | public function enableCenter() |
||
733 | |||
734 | /** |
||
735 | * Disable center of maps. |
||
736 | * |
||
737 | * @throws MapperArgumentException |
||
738 | * |
||
739 | * @return void |
||
740 | */ |
||
741 | public function disableCenter() |
||
745 | |||
746 | /** |
||
747 | * Set the map locate user status. |
||
748 | * |
||
749 | * @param boolean $value |
||
750 | * |
||
751 | * @throws MapperArgumentException |
||
752 | * |
||
753 | * @return void |
||
754 | */ |
||
755 | protected function setLocate($value) |
||
763 | |||
764 | /** |
||
765 | * Get the map locate user status. |
||
766 | * |
||
767 | * @return boolean |
||
768 | */ |
||
769 | public function getLocate() |
||
773 | |||
774 | /** |
||
775 | * Enable locate user position on maps. |
||
776 | * |
||
777 | * @throws MapperArgumentException |
||
778 | * |
||
779 | * @return void |
||
780 | */ |
||
781 | public function enableLocate() |
||
785 | |||
786 | /** |
||
787 | * Disable locate user position on maps. |
||
788 | * |
||
789 | * @throws MapperArgumentException |
||
790 | * |
||
791 | * @return void |
||
792 | */ |
||
793 | public function disableLocate() |
||
797 | |||
798 | /** |
||
799 | * Set the map UI status. |
||
800 | * |
||
801 | * @param boolean $value |
||
802 | * |
||
803 | * @throws MapperArgumentException |
||
804 | * |
||
805 | * @return void |
||
806 | */ |
||
807 | protected function setUi($value) |
||
815 | |||
816 | /** |
||
817 | * Get the map UI status. |
||
818 | * |
||
819 | * @return boolean |
||
820 | */ |
||
821 | public function getUi() |
||
825 | |||
826 | /** |
||
827 | * Enable maps ui. |
||
828 | * |
||
829 | * @throws MapperArgumentException |
||
830 | * |
||
831 | * @return void |
||
832 | */ |
||
833 | public function enableUi() |
||
837 | |||
838 | /** |
||
839 | * Disable maps ui. |
||
840 | * |
||
841 | * @throws MapperArgumentException |
||
842 | * |
||
843 | * @return void |
||
844 | */ |
||
845 | public function disableUi() |
||
849 | |||
850 | /** |
||
851 | * Set map zoom level. |
||
852 | * |
||
853 | * @param int $value |
||
854 | * |
||
855 | * @throws MapperArgumentException |
||
856 | * |
||
857 | * @return void |
||
858 | */ |
||
859 | public function setZoom($value) |
||
871 | |||
872 | /** |
||
873 | * Get map zoom level. |
||
874 | * |
||
875 | * @return int |
||
876 | */ |
||
877 | public function getZoom() |
||
881 | |||
882 | /** |
||
883 | * Set map scroll wheel zoom. |
||
884 | * |
||
885 | * @param boolean $value |
||
886 | * |
||
887 | * @throws MapperArgumentException |
||
888 | * |
||
889 | * @return void |
||
890 | */ |
||
891 | public function setScrollWheelZoom($value) |
||
899 | |||
900 | /** |
||
901 | * Get map scroll wheel zoom. |
||
902 | * |
||
903 | * @return boolean |
||
904 | */ |
||
905 | public function getScrollWheelZoom() |
||
909 | |||
910 | /** |
||
911 | * Set map zoom control. |
||
912 | * |
||
913 | * @param boolean $value |
||
914 | * |
||
915 | * @throws MapperArgumentException |
||
916 | * |
||
917 | * @return void |
||
918 | */ |
||
919 | public function setZoomControl($value) |
||
927 | |||
928 | /** |
||
929 | * Get map zoom control. |
||
930 | * |
||
931 | * @return boolean |
||
932 | */ |
||
933 | public function getZoomControl() |
||
937 | |||
938 | /** |
||
939 | * Set map type control. |
||
940 | * |
||
941 | * @param boolean $value |
||
942 | * |
||
943 | * @throws MapperArgumentException |
||
944 | * |
||
945 | * @return void |
||
946 | */ |
||
947 | public function setMapTypeControl($value) |
||
955 | |||
956 | /** |
||
957 | * Get map type control. |
||
958 | * |
||
959 | * @return boolean |
||
960 | */ |
||
961 | public function getMapTypeControl() |
||
965 | |||
966 | /** |
||
967 | * Set map scale control. |
||
968 | * |
||
969 | * @param boolean $value |
||
970 | * |
||
971 | * @throws MapperArgumentException |
||
972 | * |
||
973 | * @return void |
||
974 | */ |
||
975 | public function setScaleControl($value) |
||
983 | |||
984 | /** |
||
985 | * Get map scale control. |
||
986 | * |
||
987 | * @return boolean |
||
988 | */ |
||
989 | public function getScaleControl() |
||
993 | |||
994 | /** |
||
995 | * Set map street view control. |
||
996 | * |
||
997 | * @param boolean $value |
||
998 | * |
||
999 | * @throws MapperArgumentException |
||
1000 | * |
||
1001 | * @return void |
||
1002 | */ |
||
1003 | public function setStreetViewControl($value) |
||
1011 | |||
1012 | /** |
||
1013 | * Get map street view control. |
||
1014 | * |
||
1015 | * @return boolean |
||
1016 | */ |
||
1017 | public function getStreetViewControl() |
||
1021 | |||
1022 | /** |
||
1023 | * Set map rotate control. |
||
1024 | * |
||
1025 | * @param boolean $value |
||
1026 | * |
||
1027 | * @throws MapperArgumentException |
||
1028 | * |
||
1029 | * @return void |
||
1030 | */ |
||
1031 | public function setRotateControl($value) |
||
1039 | |||
1040 | /** |
||
1041 | * Get map rotate control. |
||
1042 | * |
||
1043 | * @return boolean |
||
1044 | */ |
||
1045 | public function getRotateControl() |
||
1049 | |||
1050 | /** |
||
1051 | * Set map fullscreen control. |
||
1052 | * |
||
1053 | * @param boolean $value |
||
1054 | * |
||
1055 | * @throws MapperArgumentException |
||
1056 | * |
||
1057 | * @return void |
||
1058 | */ |
||
1059 | public function setFullscreenControl($value) |
||
1067 | |||
1068 | /** |
||
1069 | * Get map fullscreen control. |
||
1070 | * |
||
1071 | * @return boolean |
||
1072 | */ |
||
1073 | public function getFullscreenControl() |
||
1077 | |||
1078 | /** |
||
1079 | * Set map type. |
||
1080 | * |
||
1081 | * @param string $value |
||
1082 | * |
||
1083 | * @throws MapperArgumentException |
||
1084 | * |
||
1085 | * @return void |
||
1086 | */ |
||
1087 | public function setType($value) |
||
1095 | |||
1096 | /** |
||
1097 | * Get map type. |
||
1098 | * |
||
1099 | * @return string |
||
1100 | */ |
||
1101 | public function getType() |
||
1105 | |||
1106 | /** |
||
1107 | * Set map heading. |
||
1108 | * |
||
1109 | * @param int|double $value |
||
1110 | * |
||
1111 | * @throws MapperArgumentException |
||
1112 | * |
||
1113 | * @return void |
||
1114 | */ |
||
1115 | public function setHeading($value) |
||
1123 | |||
1124 | /** |
||
1125 | * Get map heading. |
||
1126 | * |
||
1127 | * @return int|double |
||
1128 | */ |
||
1129 | public function getHeading() |
||
1133 | |||
1134 | /** |
||
1135 | * Set map tilt. |
||
1136 | * |
||
1137 | * @param int|double $value |
||
1138 | * |
||
1139 | * @throws MapperArgumentException |
||
1140 | * |
||
1141 | * @return void |
||
1142 | */ |
||
1143 | public function setTilt($value) |
||
1151 | |||
1152 | /** |
||
1153 | * Get map tilt. |
||
1154 | * |
||
1155 | * @return int |
||
1156 | */ |
||
1157 | public function getTilt() |
||
1161 | |||
1162 | /** |
||
1163 | * Set map marker icon. |
||
1164 | * |
||
1165 | * @param string $value |
||
1166 | * |
||
1167 | * @throws MapperArgumentException |
||
1168 | * |
||
1169 | * @return void |
||
1170 | */ |
||
1171 | public function setIcon($value) |
||
1179 | |||
1180 | /** |
||
1181 | * Get map marker icon. |
||
1182 | * |
||
1183 | * @return string |
||
1184 | */ |
||
1185 | public function getIcon() |
||
1189 | |||
1190 | /** |
||
1191 | * Set map marker animation. |
||
1192 | * |
||
1193 | * @param string $value |
||
1194 | * |
||
1195 | * @throws MapperArgumentException |
||
1196 | * |
||
1197 | * @return void |
||
1198 | */ |
||
1199 | public function setAnimation($value) |
||
1207 | |||
1208 | /** |
||
1209 | * Get map marker animation. |
||
1210 | * |
||
1211 | * @return string |
||
1212 | */ |
||
1213 | public function getAnimation() |
||
1217 | |||
1218 | /** |
||
1219 | * Set map gesture handling. |
||
1220 | * |
||
1221 | * @param string $value |
||
1222 | * |
||
1223 | * @throws MapperArgumentException |
||
1224 | * |
||
1225 | * @return void |
||
1226 | */ |
||
1227 | public function setGestureHandling($value) |
||
1235 | |||
1236 | /** |
||
1237 | * Get map gesture handling. |
||
1238 | * |
||
1239 | * @return string |
||
1240 | */ |
||
1241 | public function getGestureHandling() |
||
1245 | |||
1246 | /** |
||
1247 | * Set cluster status. |
||
1248 | * |
||
1249 | * @param bool $value |
||
1250 | * |
||
1251 | * @throws MapperArgumentException |
||
1252 | * |
||
1253 | * @return void |
||
1254 | */ |
||
1255 | protected function setCluster($value) |
||
1263 | |||
1264 | /** |
||
1265 | * Get the cluster status. |
||
1266 | * |
||
1267 | * @return bool |
||
1268 | */ |
||
1269 | public function getCluster() |
||
1273 | |||
1274 | /** |
||
1275 | * Enable cluster. |
||
1276 | * |
||
1277 | * @throws MapperArgumentException |
||
1278 | * |
||
1279 | * @return void |
||
1280 | */ |
||
1281 | public function enableCluster() |
||
1285 | |||
1286 | /** |
||
1287 | * Disable cluster. |
||
1288 | * |
||
1289 | * @throws MapperArgumentException |
||
1290 | * |
||
1291 | * @return void |
||
1292 | */ |
||
1293 | public function disableCluster() |
||
1297 | |||
1298 | /** |
||
1299 | * Set map cluster icon. |
||
1300 | * |
||
1301 | * @param string $value |
||
1302 | * |
||
1303 | * @throws MapperArgumentException |
||
1304 | * |
||
1305 | * @return void |
||
1306 | */ |
||
1307 | public function setClustersIcon($value) |
||
1315 | |||
1316 | /** |
||
1317 | * Get map clusters icon. |
||
1318 | * |
||
1319 | * @return string |
||
1320 | */ |
||
1321 | public function getClustersIcon() |
||
1325 | |||
1326 | /** |
||
1327 | * Set map cluster grid. |
||
1328 | * |
||
1329 | * @param int $value |
||
1330 | * |
||
1331 | * @throws MapperArgumentException |
||
1332 | * |
||
1333 | * @return void |
||
1334 | */ |
||
1335 | public function setClustersGrid($value) |
||
1343 | |||
1344 | /** |
||
1345 | * Get map cluster grid. |
||
1346 | * |
||
1347 | * @return int |
||
1348 | */ |
||
1349 | public function getClustersGrid() |
||
1353 | |||
1354 | /** |
||
1355 | * Set map cluster zoom. |
||
1356 | * |
||
1357 | * @param int|null $value |
||
1358 | * |
||
1359 | * @throws MapperArgumentException |
||
1360 | * |
||
1361 | * @return void |
||
1362 | */ |
||
1363 | public function setClustersZoom($value) |
||
1371 | |||
1372 | /** |
||
1373 | * Get map cluster grid. |
||
1374 | * |
||
1375 | * @return integer|null |
||
1376 | */ |
||
1377 | public function getClustersZoom() |
||
1381 | |||
1382 | /** |
||
1383 | * Set map cluster center. |
||
1384 | * |
||
1385 | * @param bool $value |
||
1386 | * |
||
1387 | * @throws MapperArgumentException |
||
1388 | * |
||
1389 | * @return void |
||
1390 | */ |
||
1391 | public function setClustersCenter($value) |
||
1399 | |||
1400 | /** |
||
1401 | * Get map cluster center. |
||
1402 | * |
||
1403 | * @return bool |
||
1404 | */ |
||
1405 | public function getClustersCenter() |
||
1409 | |||
1410 | /** |
||
1411 | * Set map cluster size. |
||
1412 | * |
||
1413 | * @param int $value |
||
1414 | * |
||
1415 | * @throws MapperArgumentException |
||
1416 | * |
||
1417 | * @return void |
||
1418 | */ |
||
1419 | public function setClustersSize($value) |
||
1427 | |||
1428 | /** |
||
1429 | * Get map cluster size. |
||
1430 | * |
||
1431 | * @return int |
||
1432 | */ |
||
1433 | public function getClustersSize() |
||
1437 | |||
1438 | /** |
||
1439 | * Get mapper options. |
||
1440 | * |
||
1441 | * @return array |
||
1442 | */ |
||
1443 | protected function getOptions() |
||
1487 | |||
1488 | /** |
||
1489 | * Add mapping item. |
||
1490 | * |
||
1491 | * @param object $value |
||
1492 | * |
||
1493 | * @return void |
||
1494 | */ |
||
1495 | protected function addItem($value) |
||
1499 | |||
1500 | /** |
||
1501 | * Set mapping items. |
||
1502 | * |
||
1503 | * @param array $array |
||
1504 | * |
||
1505 | * @return void |
||
1506 | */ |
||
1507 | protected function setItems(array $array) |
||
1511 | |||
1512 | /** |
||
1513 | * Get the mapping items. |
||
1514 | * |
||
1515 | * @return array |
||
1516 | */ |
||
1517 | public function getItems() |
||
1521 | |||
1522 | /** |
||
1523 | * Get a mapping item by reference. |
||
1524 | * |
||
1525 | * @param int $item |
||
1526 | * |
||
1527 | * @return array|bool |
||
1528 | */ |
||
1529 | public function getItem($item) |
||
1533 | } |
||
1534 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.