Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Game 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 Game, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
28 | abstract class Game implements InputFilterAwareInterface, Translatable, \JsonSerializable |
||
29 | { |
||
30 | // not yet published |
||
31 | const GAME_SCHEDULE = 'scheduled'; |
||
32 | // published and not yet started |
||
33 | const GAME_PUBLISHED = 'published'; |
||
34 | // published and game in progress |
||
35 | const GAME_IN_PROGRESS = 'in progress'; |
||
36 | // published and game finished |
||
37 | const GAME_FINISHED = 'finished'; |
||
38 | // closed |
||
39 | const GAME_CLOSED = 'closed'; |
||
40 | |||
41 | /** |
||
42 | * @Gedmo\Locale |
||
43 | * Used locale to override Translation listener`s locale |
||
44 | * this is not a mapped field of entity metadata, just a simple property |
||
45 | */ |
||
46 | protected $locale; |
||
47 | |||
48 | protected $inputFilter; |
||
49 | |||
50 | /** |
||
51 | * @ORM\Id |
||
52 | * @ORM\Column(type="integer"); |
||
53 | * @ORM\GeneratedValue(strategy="AUTO") |
||
54 | */ |
||
55 | protected $id; |
||
56 | |||
57 | /** |
||
58 | * @ORM\ManyToOne(targetEntity="\PlaygroundPartnership\Entity\Partner") |
||
59 | */ |
||
60 | protected $partner; |
||
61 | |||
62 | /** |
||
63 | * Implementer ManyToOne(targetEntity="PrizeCategory") avec hydrator sur le formulaire |
||
64 | * @ORM\Column(name="prize_category", type="integer", nullable=true) |
||
65 | */ |
||
66 | protected $prizeCategory; |
||
67 | |||
68 | /** |
||
69 | * @Gedmo\Translatable |
||
70 | * @ORM\Column(type="string", length=255, nullable=false) |
||
71 | */ |
||
72 | protected $title; |
||
73 | |||
74 | /** |
||
75 | * @ORM\Column(type="string", length=255, unique=true, nullable=false) |
||
76 | */ |
||
77 | protected $identifier; |
||
78 | |||
79 | /** |
||
80 | * @ORM\OneToOne(targetEntity="PlayerForm", mappedBy="game", cascade={"persist","remove"}) |
||
81 | **/ |
||
82 | protected $playerForm; |
||
83 | |||
84 | /** |
||
85 | * @Gedmo\Translatable |
||
86 | * @ORM\Column(name="main_image", type="string", length=255, nullable=true) |
||
87 | */ |
||
88 | protected $mainImage; |
||
89 | |||
90 | /** |
||
91 | * @Gedmo\Translatable |
||
92 | * @ORM\Column(name="second_image", type="string", length=255, nullable=true) |
||
93 | */ |
||
94 | protected $secondImage; |
||
95 | |||
96 | /** |
||
97 | * @ORM\Column(name="broadcast_facebook",type="boolean", nullable=true) |
||
98 | */ |
||
99 | protected $broadcastFacebook = 0; |
||
100 | |||
101 | /** |
||
102 | * @ORM\Column(name="broadcast_platform",type="boolean", nullable=true) |
||
103 | */ |
||
104 | protected $broadcastPlatform = 0; |
||
105 | |||
106 | /** |
||
107 | * @ORM\Column(type="string", length=255, nullable=true) |
||
108 | */ |
||
109 | protected $domain = null; |
||
110 | |||
111 | /** |
||
112 | * @ORM\Column(name="broadcast_post_facebook",type="boolean", nullable=true) |
||
113 | */ |
||
114 | protected $broadcastPostFacebook = 0; |
||
115 | |||
116 | /** |
||
117 | * @ORM\Column(name="push_home",type="boolean", nullable=true) |
||
118 | */ |
||
119 | protected $pushHome = 0; |
||
120 | |||
121 | /** |
||
122 | * @ORM\Column(name="display_home",type="boolean", nullable=true) |
||
123 | */ |
||
124 | protected $displayHome = 0; |
||
125 | |||
126 | /** |
||
127 | * @ORM\Column(name="mail_winner",type="boolean", nullable=true) |
||
128 | */ |
||
129 | protected $mailWinner = 0; |
||
130 | |||
131 | /** |
||
132 | * @Gedmo\Translatable |
||
133 | * @ORM\Column(name="mail_winner_block", type="text", nullable=true) |
||
134 | */ |
||
135 | protected $mailWinnerBlock; |
||
136 | |||
137 | /** |
||
138 | * @ORM\Column(name="mail_looser",type="boolean", nullable=true) |
||
139 | */ |
||
140 | protected $mailLooser = 0; |
||
141 | |||
142 | /** |
||
143 | * @Gedmo\Translatable |
||
144 | * @ORM\Column(name="mail_looser_block", type="text", nullable=true) |
||
145 | */ |
||
146 | protected $mailLooserBlock; |
||
147 | |||
148 | /** |
||
149 | * @ORM\Column(name="mail_entry",type="boolean", nullable=true) |
||
150 | */ |
||
151 | protected $mailEntry = 0; |
||
152 | |||
153 | /** |
||
154 | * @ORM\Column(name="email_share",type="boolean", nullable=true) |
||
155 | */ |
||
156 | protected $emailShare = 0; |
||
157 | |||
158 | /** |
||
159 | * @ORM\Column(name="fb_share",type="boolean", nullable=true) |
||
160 | */ |
||
161 | protected $fbShare = 0; |
||
162 | |||
163 | /** |
||
164 | * @ORM\Column(name="tw_share",type="boolean", nullable=true) |
||
165 | */ |
||
166 | protected $twShare = 0; |
||
167 | |||
168 | /** |
||
169 | * @ORM\Column(type="boolean", nullable=false) |
||
170 | */ |
||
171 | protected $active = 0; |
||
172 | |||
173 | /** |
||
174 | * @ORM\Column(type="boolean", nullable=false) |
||
175 | */ |
||
176 | protected $onInvitation = false; |
||
177 | |||
178 | /** |
||
179 | * @ORM\OneToMany(targetEntity="Invitation", mappedBy="game", cascade={"persist","remove"}, orphanRemoval=true) |
||
180 | */ |
||
181 | private $invitations; |
||
182 | |||
183 | /** |
||
184 | * @ORM\Column(name="anonymous_allowed",type="boolean", nullable=true) |
||
185 | */ |
||
186 | protected $anonymousAllowed = 0; |
||
187 | |||
188 | /** |
||
189 | * This column can be filled in when anonymousAllowed = 1. |
||
190 | * If you put a value, it has to be a field key from playerdata. This key will |
||
191 | * then be used to identify a player (generally 'email') |
||
192 | * |
||
193 | * @ORM\Column(name="anonymous_identifier", type="text", nullable=true) |
||
194 | */ |
||
195 | protected $anonymousIdentifier; |
||
196 | |||
197 | /** |
||
198 | * @ORM\Column(name="publication_date", type="datetime", nullable=true) |
||
199 | */ |
||
200 | protected $publicationDate; |
||
201 | |||
202 | /** |
||
203 | * @ORM\Column(name="start_date", type="datetime", nullable=true) |
||
204 | */ |
||
205 | protected $startDate; |
||
206 | |||
207 | /** |
||
208 | * @ORM\Column(name="end_date", type="datetime", nullable=true) |
||
209 | */ |
||
210 | protected $endDate; |
||
211 | |||
212 | /** |
||
213 | * @ORM\Column(name="close_date", type="datetime", nullable=true) |
||
214 | */ |
||
215 | protected $closeDate; |
||
216 | |||
217 | /** |
||
218 | * play limitation. 0 : No limit |
||
219 | * |
||
220 | * @ORM\Column(name="play_limit", type="integer", nullable=false) |
||
221 | */ |
||
222 | protected $playLimit = 0; |
||
223 | |||
224 | /** |
||
225 | * this field is taken into account only if playLimit<>0. |
||
226 | * if 'always' only $playLimit play by person for this game |
||
227 | * if 'day' only $playLimit play by person a day |
||
228 | * if 'week' only $playLimit play by person a week |
||
229 | * if 'month' only $playLimit play by person a month |
||
230 | * if 'year' only $playLimit play by person a year |
||
231 | * |
||
232 | * @ORM\Column(name="play_limit_scale", type="string", nullable=true) |
||
233 | */ |
||
234 | protected $playLimitScale; |
||
235 | |||
236 | /** |
||
237 | * this field is used for offering a complementary play entry |
||
238 | * (for example, when the player share the game). The entries |
||
239 | * of type 'bonus' won't be taken into account in the calaculation |
||
240 | * of the authorized playLimit. |
||
241 | * |
||
242 | * if 'none' or null no play bonus is offered |
||
243 | * if 'per_entry' a play bonus is offered for each entry |
||
244 | * if 'one' only one play bonus is offered for every entries of the game |
||
245 | * |
||
246 | * @ORM\Column(name="play_bonus", type="string", nullable=true) |
||
247 | */ |
||
248 | protected $playBonus; |
||
249 | |||
250 | /** |
||
251 | * @ORM\Column(type="string", length=255, nullable=true) |
||
252 | */ |
||
253 | protected $layout; |
||
254 | |||
255 | /** |
||
256 | * @ORM\Column(type="string", length=255, nullable=true) |
||
257 | */ |
||
258 | protected $stylesheet; |
||
259 | |||
260 | /** |
||
261 | * @Gedmo\Translatable |
||
262 | * @ORM\Column(name="welcome_block", type="text", nullable=true) |
||
263 | */ |
||
264 | protected $welcomeBlock; |
||
265 | |||
266 | /** |
||
267 | * @Gedmo\Translatable |
||
268 | * @ORM\Column(type="text", nullable=true) |
||
269 | */ |
||
270 | protected $termsBlock; |
||
271 | |||
272 | /** |
||
273 | * @ORM\Column(name="terms_optin", type="boolean", nullable=true) |
||
274 | */ |
||
275 | protected $termsOptin = 0; |
||
276 | |||
277 | /** |
||
278 | * @Gedmo\Translatable |
||
279 | * @ORM\Column(type="text", nullable=true) |
||
280 | */ |
||
281 | protected $conditionsBlock; |
||
282 | |||
283 | /** |
||
284 | * @ORM\OneToMany(targetEntity="Prize", mappedBy="game", cascade={"persist","remove"}, orphanRemoval=true) |
||
285 | */ |
||
286 | private $prizes; |
||
287 | |||
288 | /** |
||
289 | * @ORM\Column(name="fb_page_id", type="string", nullable=true) |
||
290 | */ |
||
291 | protected $fbPageId; |
||
292 | |||
293 | /** |
||
294 | * @ORM\Column(name="fb_app_id", type="string", nullable=true) |
||
295 | */ |
||
296 | protected $fbAppId; |
||
297 | |||
298 | /** |
||
299 | * @ORM\Column(name="fb_post_id", type="string", nullable=true) |
||
300 | */ |
||
301 | protected $fbPostId; |
||
302 | |||
303 | /** |
||
304 | * @Gedmo\Translatable |
||
305 | * @ORM\Column(name="fb_page_tab_title", type="string", length=255, nullable=true) |
||
306 | */ |
||
307 | protected $fbPageTabTitle; |
||
308 | |||
309 | /** |
||
310 | * @ORM\Column(name="fb_page_tab_image", type="string", length=255, nullable=true) |
||
311 | */ |
||
312 | protected $fbPageTabImage; |
||
313 | |||
314 | /** |
||
315 | * What is the tab's position. 0 : the highest |
||
316 | * |
||
317 | * @ORM\Column(name="fb_page_tab_position", type="integer", nullable=false) |
||
318 | */ |
||
319 | protected $fbPageTabPosition = 0; |
||
320 | |||
321 | /** |
||
322 | * @Gedmo\Translatable |
||
323 | * @ORM\Column(name="email_share_subject", type="text", nullable=true) |
||
324 | */ |
||
325 | protected $emailShareSubject; |
||
326 | |||
327 | /** |
||
328 | * @Gedmo\Translatable |
||
329 | * @ORM\Column(name="email_share_message", type="text", nullable=true) |
||
330 | */ |
||
331 | protected $emailShareMessage; |
||
332 | |||
333 | /** |
||
334 | * @Gedmo\Translatable |
||
335 | * @ORM\Column(name="fb_share_description", type="text", nullable=true) |
||
336 | */ |
||
337 | protected $fbShareDescription; |
||
338 | |||
339 | /** |
||
340 | * @ORM\Column(name="fb_share_image", type="string", length=255, nullable=true) |
||
341 | */ |
||
342 | protected $fbShareImage; |
||
343 | |||
344 | /** |
||
345 | * @Gedmo\Translatable |
||
346 | * @ORM\Column(name="fb_request_message", type="text", nullable=true) |
||
347 | */ |
||
348 | protected $fbRequestMessage; |
||
349 | |||
350 | /** |
||
351 | * @Gedmo\Translatable |
||
352 | * @ORM\Column(name="tw_share_message", type="string", length=255, nullable=true) |
||
353 | */ |
||
354 | protected $twShareMessage; |
||
355 | |||
356 | /** |
||
357 | * available steps : index, register, play, result, bounce |
||
358 | * This string is transformed into an array and represents the workflow of the game |
||
359 | * @ORM\Column(name="steps", type="string", length=255, nullable=true) |
||
360 | */ |
||
361 | protected $steps = 'play,result'; |
||
362 | |||
363 | /** |
||
364 | * @ORM\Column(name="steps_views", type="string", length=255, nullable=true) |
||
365 | */ |
||
366 | protected $stepsViews = '{"index":{},"play":{},"result":{},"bounce":{}}'; |
||
367 | |||
368 | /** |
||
369 | * If you enter a value, this will be the condition to enter the game |
||
370 | * The cost will apply to the "wallet" of the player which correspond to a leaderboard |
||
371 | * @ORM\Column(name="cost_to_play", type="integer", nullable=true) |
||
372 | */ |
||
373 | protected $costToPlay = 0; |
||
374 | |||
375 | /** |
||
376 | * Doctrine accessible value of discriminator (field 'type' is not |
||
377 | * accessible through query) |
||
378 | * And I want to be able to sort game collection based on type |
||
379 | * http://www.doctrine-project.org/jira/browse/DDC-707 |
||
380 | * @ORM\Column(name="class_type", type="string", length=255, nullable=false) |
||
381 | */ |
||
382 | protected $classType; |
||
383 | |||
384 | /** |
||
385 | * @ORM\Column(name="created_at", type="datetime") |
||
386 | */ |
||
387 | protected $createdAt; |
||
388 | |||
389 | /** |
||
390 | * @ORM\Column(name="updated_at", type="datetime") |
||
391 | */ |
||
392 | protected $updatedAt; |
||
393 | |||
394 | public function __construct() |
||
399 | |||
400 | /** |
||
401 | * @PrePersist |
||
402 | */ |
||
403 | public function createChrono() |
||
408 | |||
409 | /** |
||
410 | * @PreUpdate |
||
411 | */ |
||
412 | public function updateChrono() |
||
416 | |||
417 | /** |
||
418 | * |
||
419 | * @return the $id |
||
420 | */ |
||
421 | public function getId() |
||
425 | |||
426 | /** |
||
427 | * |
||
428 | * @param field_type $id |
||
429 | */ |
||
430 | public function setId($id) |
||
436 | |||
437 | /** |
||
438 | * @return the $playerForm |
||
439 | */ |
||
440 | public function getPlayerForm() |
||
444 | |||
445 | /** |
||
446 | * @param field_type $playerForm |
||
447 | */ |
||
448 | public function setPlayerForm($playerForm) |
||
454 | |||
455 | /** |
||
456 | * |
||
457 | * @return the unknown_type |
||
458 | */ |
||
459 | public function getPartner() |
||
463 | |||
464 | /** |
||
465 | * |
||
466 | * @param unknown_type $partner |
||
467 | */ |
||
468 | public function setPartner($partner) |
||
474 | |||
475 | /** |
||
476 | * |
||
477 | * @param unknown_type $prizeCategory |
||
478 | */ |
||
479 | public function setPrizeCategory($prizeCategory) |
||
485 | |||
486 | /** |
||
487 | * |
||
488 | * @return the unknown_type |
||
489 | */ |
||
490 | public function getPrizeCategory() |
||
494 | |||
495 | /** |
||
496 | * |
||
497 | * @return the $title |
||
498 | */ |
||
499 | public function getTitle() |
||
503 | |||
504 | /** |
||
505 | * |
||
506 | * @param field_type $title |
||
507 | */ |
||
508 | public function setTitle($title) |
||
514 | |||
515 | /** |
||
516 | * |
||
517 | * @return the $identifier |
||
518 | */ |
||
519 | public function getIdentifier() |
||
523 | |||
524 | /** |
||
525 | * |
||
526 | * @param field_type $identifier |
||
527 | */ |
||
528 | public function setIdentifier($identifier) |
||
534 | |||
535 | /** |
||
536 | * @return integer $anonymousAllowed |
||
537 | */ |
||
538 | public function getAnonymousAllowed() |
||
542 | |||
543 | /** |
||
544 | * @param number $anonymousAllowed |
||
545 | */ |
||
546 | public function setAnonymousAllowed($anonymousAllowed) |
||
552 | |||
553 | /** |
||
554 | * @return the $anonymousIdentifier |
||
555 | */ |
||
556 | public function getAnonymousIdentifier() |
||
560 | |||
561 | /** |
||
562 | * @param field_type $anonymousIdentifier |
||
563 | */ |
||
564 | public function setAnonymousIdentifier($anonymousIdentifier) |
||
568 | |||
569 | /** |
||
570 | * |
||
571 | * @return the $mainImage |
||
572 | */ |
||
573 | public function getMainImage() |
||
577 | |||
578 | /** |
||
579 | * |
||
580 | * @param field_type $mainImage |
||
581 | */ |
||
582 | public function setMainImage($mainImage) |
||
588 | |||
589 | /** |
||
590 | * |
||
591 | * @return the $secondImage |
||
592 | */ |
||
593 | public function getSecondImage() |
||
597 | |||
598 | /** |
||
599 | * |
||
600 | * @param field_type $secondImage |
||
601 | */ |
||
602 | public function setSecondImage($secondImage) |
||
608 | |||
609 | /** |
||
610 | * |
||
611 | * @return integer $broadcastFacebook |
||
612 | */ |
||
613 | public function getBroadcastFacebook() |
||
617 | |||
618 | /** |
||
619 | * |
||
620 | * @param field_type $broadcastFacebook |
||
621 | */ |
||
622 | public function setBroadcastFacebook($broadcastFacebook) |
||
628 | |||
629 | /** |
||
630 | * |
||
631 | * @return integer $domain |
||
632 | */ |
||
633 | public function getDomain() |
||
637 | |||
638 | /** |
||
639 | * |
||
640 | * @param field_type $domain |
||
641 | */ |
||
642 | public function setDomain($domain) |
||
648 | |||
649 | /** |
||
650 | * |
||
651 | * @return integer $broadcastPlatform |
||
652 | */ |
||
653 | public function getBroadcastPlatform() |
||
657 | |||
658 | /** |
||
659 | * |
||
660 | * @param field_type $broadcastPlatform |
||
661 | */ |
||
662 | public function setBroadcastPlatform($broadcastPlatform) |
||
668 | |||
669 | /** |
||
670 | * @return integer $broadcastPostFacebook |
||
671 | */ |
||
672 | public function getBroadcastPostFacebook() |
||
676 | |||
677 | /** |
||
678 | * @param number $broadcastPostFacebook |
||
679 | */ |
||
680 | public function setBroadcastPostFacebook($broadcastPostFacebook) |
||
686 | |||
687 | /** |
||
688 | * @return integer $mailWinner |
||
689 | */ |
||
690 | public function getMailWinner() |
||
694 | |||
695 | /** |
||
696 | * @param number $mailWinner |
||
697 | */ |
||
698 | public function setMailWinner($mailWinner) |
||
702 | |||
703 | /** |
||
704 | * @return the $mailWinnerBlock |
||
705 | */ |
||
706 | public function getMailWinnerBlock() |
||
710 | |||
711 | /** |
||
712 | * @param field_type $mailWinnerBlock |
||
713 | */ |
||
714 | public function setMailWinnerBlock($mailWinnerBlock) |
||
718 | |||
719 | /** |
||
720 | * @return integer $mailEntry |
||
721 | */ |
||
722 | public function getMailEntry() |
||
726 | |||
727 | /** |
||
728 | * @param number $mailEntry |
||
729 | */ |
||
730 | public function setMailEntry($mailEntry) |
||
734 | |||
735 | /** |
||
736 | * @return boolean $emailShare |
||
737 | */ |
||
738 | public function getEmailShare() |
||
742 | |||
743 | /** |
||
744 | * @param boolean $emailShare |
||
745 | */ |
||
746 | public function setEmailShare($emailShare) |
||
750 | |||
751 | /** |
||
752 | * @return boolean $fbShare |
||
753 | */ |
||
754 | public function getFbShare() |
||
758 | |||
759 | /** |
||
760 | * @param boolean $fbShare |
||
761 | */ |
||
762 | public function setFbShare($fbShare) |
||
766 | |||
767 | /** |
||
768 | * @return boolean $twShare |
||
769 | */ |
||
770 | public function getTwShare() |
||
774 | |||
775 | /** |
||
776 | * @param boolean $twShare |
||
777 | */ |
||
778 | public function setTwShare($twShare) |
||
782 | |||
783 | /** |
||
784 | * @return integer $mailLooser |
||
785 | */ |
||
786 | public function getMailLooser() |
||
790 | |||
791 | /** |
||
792 | * @param number $mailLooser |
||
793 | */ |
||
794 | public function setMailLooser($mailLooser) |
||
798 | |||
799 | /** |
||
800 | * @return the $mailLooserBlock |
||
801 | */ |
||
802 | public function getMailLooserBlock() |
||
806 | |||
807 | /** |
||
808 | * @param field_type $mailLooserBlock |
||
809 | */ |
||
810 | public function setMailLooserBlock($mailLooserBlock) |
||
814 | |||
815 | /** |
||
816 | * |
||
817 | * @return integer $pushHome |
||
818 | */ |
||
819 | public function getPushHome() |
||
823 | |||
824 | /** |
||
825 | * |
||
826 | * @param field_type $pushHome |
||
827 | */ |
||
828 | public function setPushHome($pushHome) |
||
834 | |||
835 | /** |
||
836 | * |
||
837 | * @return integer $displayHome |
||
838 | */ |
||
839 | public function getDisplayHome() |
||
843 | |||
844 | /** |
||
845 | * |
||
846 | * @param field_type $displayHome |
||
847 | */ |
||
848 | public function setDisplayHome($displayHome) |
||
854 | |||
855 | /** |
||
856 | * |
||
857 | * @return the $publicationDate |
||
858 | */ |
||
859 | public function getPublicationDate() |
||
863 | |||
864 | /** |
||
865 | * |
||
866 | * @param field_type $publicationDate |
||
867 | */ |
||
868 | public function setPublicationDate($publicationDate) |
||
874 | |||
875 | /** |
||
876 | * |
||
877 | * @return the $startDate |
||
878 | */ |
||
879 | public function getStartDate() |
||
883 | |||
884 | /** |
||
885 | * |
||
886 | * @param field_type $startDate |
||
887 | */ |
||
888 | public function setStartDate($startDate) |
||
894 | |||
895 | /** |
||
896 | * |
||
897 | * @return the $endDate |
||
898 | */ |
||
899 | public function getEndDate() |
||
903 | |||
904 | /** |
||
905 | * |
||
906 | * @param field_type $endDate |
||
907 | */ |
||
908 | public function setEndDate($endDate) |
||
914 | |||
915 | /** |
||
916 | * |
||
917 | * @return the $closeDate |
||
918 | */ |
||
919 | public function getCloseDate() |
||
923 | |||
924 | /** |
||
925 | * |
||
926 | * @param field_type $closeDate |
||
927 | */ |
||
928 | public function setCloseDate($closeDate) |
||
934 | |||
935 | public function isClosed() |
||
947 | |||
948 | public function isOpen() |
||
952 | |||
953 | View Code Duplication | public function isStarted() |
|
964 | |||
965 | View Code Duplication | public function isFinished() |
|
977 | |||
978 | public function isOnline() |
||
986 | |||
987 | // json array : {"0":"index","1":"play","2":"result","3":"bounce"} |
||
988 | public function getStepsArray() |
||
1002 | |||
1003 | public function getStepsViewsArray() |
||
1016 | |||
1017 | public function getSteps() |
||
1021 | |||
1022 | public function setSteps($steps) |
||
1028 | |||
1029 | /** |
||
1030 | * This method returns the first step in the game workflow |
||
1031 | * @return string |
||
1032 | */ |
||
1033 | public function firstStep() |
||
1039 | |||
1040 | /** |
||
1041 | * This method returns the last step in the game workflow |
||
1042 | * @return string |
||
1043 | */ |
||
1044 | public function lastStep() |
||
1051 | |||
1052 | /** |
||
1053 | * This method returns the previous step in the game workflow |
||
1054 | * @param string $step |
||
1055 | * @return string |
||
1056 | */ |
||
1057 | View Code Duplication | public function previousStep($step = null) |
|
1068 | |||
1069 | /** |
||
1070 | * This method returns the next step in the game workflow |
||
1071 | * @param string $step |
||
1072 | * @return string |
||
1073 | */ |
||
1074 | View Code Duplication | public function nextStep($step = null) |
|
1085 | |||
1086 | /** |
||
1087 | * @return string $stepsViews |
||
1088 | */ |
||
1089 | public function getStepsViews() |
||
1093 | |||
1094 | /** |
||
1095 | * @param string $stepsViews |
||
1096 | */ |
||
1097 | public function setStepsViews($stepsViews) |
||
1103 | |||
1104 | public function getState() |
||
1122 | |||
1123 | /** |
||
1124 | * @return integer unknown_type |
||
1125 | */ |
||
1126 | public function getPlayLimit() |
||
1130 | |||
1131 | /** |
||
1132 | * @param unknown_type $playLimit |
||
1133 | */ |
||
1134 | public function setPlayLimit($playLimit) |
||
1140 | |||
1141 | /** |
||
1142 | * @return the unknown_type |
||
1143 | */ |
||
1144 | public function getPlayLimitScale() |
||
1148 | |||
1149 | /** |
||
1150 | * @param unknown_type $playLimitScale |
||
1151 | */ |
||
1152 | public function setPlayLimitScale($playLimitScale) |
||
1158 | |||
1159 | /** |
||
1160 | * @return the unknown_type |
||
1161 | */ |
||
1162 | public function getPlayBonus() |
||
1166 | |||
1167 | /** |
||
1168 | * @param unknown_type $playBonus |
||
1169 | */ |
||
1170 | public function setPlayBonus($playBonus) |
||
1176 | |||
1177 | /** |
||
1178 | * |
||
1179 | * @return the $layout |
||
1180 | */ |
||
1181 | public function getLayout() |
||
1185 | |||
1186 | /** |
||
1187 | * |
||
1188 | * @param field_type $layout |
||
1189 | */ |
||
1190 | public function setLayout($layout) |
||
1196 | |||
1197 | /** |
||
1198 | * |
||
1199 | * @return the $stylesheet |
||
1200 | */ |
||
1201 | public function getStylesheet() |
||
1205 | |||
1206 | /** |
||
1207 | * |
||
1208 | * @param field_type $stylesheet |
||
1209 | */ |
||
1210 | public function setStylesheet($stylesheet) |
||
1216 | |||
1217 | /** |
||
1218 | * |
||
1219 | * @return the $welcomeBlock |
||
1220 | */ |
||
1221 | public function getWelcomeBlock() |
||
1225 | |||
1226 | /** |
||
1227 | * |
||
1228 | * @param field_type $welcomeBlock |
||
1229 | */ |
||
1230 | public function setWelcomeBlock($welcomeBlock) |
||
1236 | |||
1237 | /** |
||
1238 | * |
||
1239 | * @return the $termsBlock |
||
1240 | */ |
||
1241 | public function getTermsBlock() |
||
1245 | |||
1246 | /** |
||
1247 | * |
||
1248 | * @param text $termsBlock |
||
1249 | */ |
||
1250 | public function setTermsBlock($termsBlock) |
||
1256 | |||
1257 | /** |
||
1258 | * |
||
1259 | * @return integer $termsOptin |
||
1260 | */ |
||
1261 | public function getTermsOptin() |
||
1265 | |||
1266 | /** |
||
1267 | * |
||
1268 | * @param text $termsOptin |
||
1269 | */ |
||
1270 | public function setTermsOptin($termsOptin) |
||
1276 | |||
1277 | /** |
||
1278 | * |
||
1279 | * @return the $conditionsBlock |
||
1280 | */ |
||
1281 | public function getConditionsBlock() |
||
1285 | |||
1286 | /** |
||
1287 | * |
||
1288 | * @param text $conditionsBlock |
||
1289 | */ |
||
1290 | public function setConditionsBlock($conditionsBlock) |
||
1296 | |||
1297 | /** |
||
1298 | * @return ArrayCollection unknown_type |
||
1299 | */ |
||
1300 | public function getPrizes() |
||
1304 | |||
1305 | /** |
||
1306 | * frm collection solution |
||
1307 | * @param ArrayCollection $prizes |
||
1308 | */ |
||
1309 | public function setPrizes(ArrayCollection $prizes) |
||
1315 | |||
1316 | public function addPrizes(ArrayCollection $prizes) |
||
1323 | |||
1324 | |||
1325 | public function removePrizes(ArrayCollection $prizes) |
||
1332 | |||
1333 | /** |
||
1334 | * Add a prize to the game. |
||
1335 | * |
||
1336 | * @param Prize $prize |
||
1337 | * |
||
1338 | * @return void |
||
1339 | */ |
||
1340 | public function addPrize($prize) |
||
1344 | |||
1345 | /** |
||
1346 | * |
||
1347 | * @return string $classType |
||
1348 | */ |
||
1349 | public function getClassType() |
||
1353 | |||
1354 | /** |
||
1355 | * |
||
1356 | * @param string classType |
||
1357 | * @param string $classType |
||
1358 | */ |
||
1359 | public function setClassType($classType) |
||
1365 | |||
1366 | /** |
||
1367 | * |
||
1368 | * @return integer unknown_type |
||
1369 | */ |
||
1370 | public function getActive() |
||
1374 | |||
1375 | /** |
||
1376 | * |
||
1377 | * @param unknown_type $active |
||
1378 | */ |
||
1379 | public function setActive($active) |
||
1385 | |||
1386 | /** |
||
1387 | * |
||
1388 | * @return the $costToPlay |
||
1389 | */ |
||
1390 | public function getCostToPlay() |
||
1394 | |||
1395 | /** |
||
1396 | * |
||
1397 | * @param field_type $costToPlay |
||
1398 | */ |
||
1399 | public function setCostToPlay($costToPlay) |
||
1405 | |||
1406 | /** |
||
1407 | * |
||
1408 | * @return boolean $onInvitation |
||
1409 | */ |
||
1410 | public function getOnInvitation() |
||
1414 | |||
1415 | /** |
||
1416 | * |
||
1417 | * @param boolean $onInvitation |
||
1418 | */ |
||
1419 | public function setOnInvitation($onInvitation) |
||
1425 | |||
1426 | /** |
||
1427 | * @return ArrayCollection unknown_type |
||
1428 | */ |
||
1429 | public function getInvitations() |
||
1433 | |||
1434 | /** |
||
1435 | * @param ArrayCollection $invitations |
||
1436 | */ |
||
1437 | public function setInvitations(ArrayCollection $invitations) |
||
1443 | |||
1444 | public function addInvitations(ArrayCollection $invitations) |
||
1451 | |||
1452 | public function removeInvitations(ArrayCollection $invitations) |
||
1459 | |||
1460 | /** |
||
1461 | * Add an invitation to the game. |
||
1462 | * |
||
1463 | * @param Invitation $invitation |
||
1464 | * |
||
1465 | * @return void |
||
1466 | */ |
||
1467 | public function addInvitation($invitation) |
||
1471 | |||
1472 | |||
1473 | /** |
||
1474 | * |
||
1475 | * @return string the Facebook app_id |
||
1476 | */ |
||
1477 | public function getFbPageId() |
||
1481 | |||
1482 | /** |
||
1483 | * |
||
1484 | * @param string $fbPageId |
||
1485 | */ |
||
1486 | public function setFbPageId($fbPageId) |
||
1492 | |||
1493 | /** |
||
1494 | * |
||
1495 | * @return string the Facebook app_id |
||
1496 | */ |
||
1497 | public function getFbAppId() |
||
1501 | |||
1502 | /** |
||
1503 | * |
||
1504 | * @param string $fbAppId |
||
1505 | */ |
||
1506 | public function setFbAppId($fbAppId) |
||
1512 | |||
1513 | /** |
||
1514 | * |
||
1515 | * @return string the Facebook app_id |
||
1516 | */ |
||
1517 | public function getFbPostId() |
||
1521 | |||
1522 | /** |
||
1523 | * |
||
1524 | * @param string $fbPostId |
||
1525 | */ |
||
1526 | public function setFbPostId($fbPostId) |
||
1532 | |||
1533 | /** |
||
1534 | * |
||
1535 | * @return string the Facebook fbPageTabTitle |
||
1536 | */ |
||
1537 | public function getFbPageTabTitle() |
||
1541 | |||
1542 | /** |
||
1543 | * |
||
1544 | * @param string $fbPageTabTitle |
||
1545 | */ |
||
1546 | public function setFbPageTabTitle($fbPageTabTitle) |
||
1552 | |||
1553 | /** |
||
1554 | * |
||
1555 | * @return string the Facebook fbPageTabImage |
||
1556 | */ |
||
1557 | public function getFbPageTabImage() |
||
1561 | |||
1562 | /** |
||
1563 | * |
||
1564 | * @param string $fbPageTabImage |
||
1565 | */ |
||
1566 | public function setFbPageTabImage($fbPageTabImage) |
||
1572 | |||
1573 | /** |
||
1574 | * |
||
1575 | * @return string the Facebook fbPageTabPosition |
||
1576 | */ |
||
1577 | public function getFbPageTabPosition() |
||
1581 | |||
1582 | /** |
||
1583 | * |
||
1584 | * @param string $fbPageTabPosition |
||
1585 | */ |
||
1586 | public function setFbPageTabPosition($fbPageTabPosition) |
||
1592 | |||
1593 | /** |
||
1594 | * |
||
1595 | * @return the string |
||
1596 | */ |
||
1597 | public function getEmailShareSubject() |
||
1601 | |||
1602 | /** |
||
1603 | * |
||
1604 | * @param string $emailShareSubject |
||
1605 | */ |
||
1606 | public function setEmailShareSubject($emailShareSubject) |
||
1612 | |||
1613 | /** |
||
1614 | * |
||
1615 | * @return the unknown_type |
||
1616 | */ |
||
1617 | public function getEmailShareMessage() |
||
1621 | |||
1622 | /** |
||
1623 | * |
||
1624 | * @param unknown_type $emailShareMessage |
||
1625 | */ |
||
1626 | public function setEmailShareMessage($emailShareMessage) |
||
1632 | |||
1633 | /** |
||
1634 | * |
||
1635 | * @return the string |
||
1636 | */ |
||
1637 | public function getFbShareDescription() |
||
1641 | |||
1642 | /** |
||
1643 | * |
||
1644 | * @param string $fbShareDescription |
||
1645 | */ |
||
1646 | public function setFbShareDescription($fbShareDescription) |
||
1652 | |||
1653 | /** |
||
1654 | * |
||
1655 | * @return the unknown_type |
||
1656 | */ |
||
1657 | public function getFbShareImage() |
||
1661 | |||
1662 | /** |
||
1663 | * |
||
1664 | * @param unknown_type $fbShareImage |
||
1665 | */ |
||
1666 | public function setFbShareImage($fbShareImage) |
||
1672 | |||
1673 | /** |
||
1674 | * |
||
1675 | * @return string unknown_type |
||
1676 | */ |
||
1677 | public function getFbRequestMessage() |
||
1681 | |||
1682 | /** |
||
1683 | * |
||
1684 | * @param unknown_type $fbRequestMessage |
||
1685 | */ |
||
1686 | public function setFbRequestMessage($fbRequestMessage) |
||
1692 | |||
1693 | /** |
||
1694 | * |
||
1695 | * @return the unknown_type |
||
1696 | */ |
||
1697 | public function getTwShareMessage() |
||
1701 | |||
1702 | /** |
||
1703 | * |
||
1704 | * @param unknown_type $twShareMessage |
||
1705 | */ |
||
1706 | public function setTwShareMessage($twShareMessage) |
||
1712 | |||
1713 | /** |
||
1714 | * |
||
1715 | * @return DateTime $createdAt |
||
1716 | */ |
||
1717 | public function getCreatedAt() |
||
1721 | |||
1722 | /** |
||
1723 | * |
||
1724 | * @param \DateTime $createdAt |
||
1725 | */ |
||
1726 | public function setCreatedAt($createdAt) |
||
1732 | |||
1733 | /** |
||
1734 | * |
||
1735 | * @return DateTime $updatedAt |
||
1736 | */ |
||
1737 | public function getUpdatedAt() |
||
1741 | |||
1742 | /** |
||
1743 | * |
||
1744 | * @param \DateTime $updatedAt |
||
1745 | */ |
||
1746 | public function setUpdatedAt($updatedAt) |
||
1752 | |||
1753 | /** |
||
1754 | * Convert the object to an array. |
||
1755 | * |
||
1756 | * @return array |
||
1757 | */ |
||
1758 | public function getArrayCopy() |
||
1774 | |||
1775 | /** |
||
1776 | * Convert the object to json. |
||
1777 | * |
||
1778 | * @return array |
||
1779 | */ |
||
1780 | public function jsonSerialize() |
||
1784 | |||
1785 | /** |
||
1786 | * Populate from an array. |
||
1787 | * |
||
1788 | * @param array $data |
||
1789 | */ |
||
1790 | public function populate($data = array()) |
||
1842 | |||
1843 | public function setInputFilter(InputFilterInterface $inputFilter) |
||
1847 | |||
1848 | public function getInputFilter() |
||
2308 | |||
2309 | public function setTranslatableLocale($locale) |
||
2313 | } |
||
2314 |
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.