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 Session 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 Session, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 28 | class Session |
||
| 29 | { |
||
| 30 | const VISIBLE = 1; |
||
| 31 | const READ_ONLY = 2; |
||
| 32 | const INVISIBLE = 3; |
||
| 33 | const AVAILABLE = 4; |
||
| 34 | |||
| 35 | const STUDENT = 0; |
||
| 36 | const DRH = 1; |
||
| 37 | const COACH = 2; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var integer |
||
| 41 | * |
||
| 42 | * @ORM\Column(name="id", type="integer", nullable=false, unique=false) |
||
| 43 | * @ORM\Id |
||
| 44 | * @ORM\GeneratedValue(strategy="AUTO") |
||
| 45 | */ |
||
| 46 | private $id; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @var string |
||
| 50 | * |
||
| 51 | * @ORM\Column(name="name", type="string", length=150, nullable=false, unique=false) |
||
| 52 | */ |
||
| 53 | private $name; |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @var string |
||
| 57 | * |
||
| 58 | * @ORM\Column(name="description", type="text", nullable=true, unique=false) |
||
| 59 | */ |
||
| 60 | private $description; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * @var string |
||
| 64 | * |
||
| 65 | * @ORM\Column(name="show_description", type="boolean", nullable=true) |
||
| 66 | */ |
||
| 67 | private $showDescription; |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @var integer |
||
| 71 | * |
||
| 72 | * @ORM\Column(name="duration", type="integer", nullable=true) |
||
| 73 | */ |
||
| 74 | private $duration; |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @var integer |
||
| 78 | * |
||
| 79 | * @ORM\Column(name="nbr_courses", type="smallint", nullable=true, unique=false) |
||
| 80 | */ |
||
| 81 | private $nbrCourses; |
||
| 82 | |||
| 83 | /** |
||
| 84 | * @var integer |
||
| 85 | * |
||
| 86 | * @ORM\Column(name="nbr_users", type="integer", nullable=true, unique=false) |
||
| 87 | */ |
||
| 88 | private $nbrUsers; |
||
| 89 | |||
| 90 | /** |
||
| 91 | * @var integer |
||
| 92 | * |
||
| 93 | * @ORM\Column(name="nbr_classes", type="integer", nullable=true, unique=false) |
||
| 94 | */ |
||
| 95 | private $nbrClasses; |
||
| 96 | |||
| 97 | /** |
||
| 98 | * @var integer |
||
| 99 | * |
||
| 100 | * @ORM\Column(name="session_admin_id", type="integer", nullable=true, unique=false) |
||
| 101 | */ |
||
| 102 | private $sessionAdminId; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * @var integer |
||
| 106 | * |
||
| 107 | * @ORM\Column(name="visibility", type="integer", nullable=false, unique=false) |
||
| 108 | */ |
||
| 109 | private $visibility; |
||
| 110 | |||
| 111 | /** |
||
| 112 | * @var integer |
||
| 113 | * |
||
| 114 | * @ORM\Column(name="promotion_id", type="integer", nullable=true, unique=false) |
||
| 115 | */ |
||
| 116 | private $promotionId; |
||
| 117 | |||
| 118 | /** |
||
| 119 | * @var \DateTime |
||
| 120 | * |
||
| 121 | * @ORM\Column(name="display_start_date", type="datetime", nullable=true, unique=false) |
||
| 122 | */ |
||
| 123 | private $displayStartDate; |
||
| 124 | |||
| 125 | /** |
||
| 126 | * @var \DateTime |
||
| 127 | * |
||
| 128 | * @ORM\Column(name="display_end_date", type="datetime", nullable=true, unique=false) |
||
| 129 | */ |
||
| 130 | private $displayEndDate; |
||
| 131 | |||
| 132 | /** |
||
| 133 | * @var \DateTime |
||
| 134 | * |
||
| 135 | * @ORM\Column(name="access_start_date", type="datetime", nullable=true, unique=false) |
||
| 136 | */ |
||
| 137 | private $accessStartDate; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * @var \DateTime |
||
| 141 | * |
||
| 142 | * @ORM\Column(name="access_end_date", type="datetime", nullable=true, unique=false) |
||
| 143 | */ |
||
| 144 | private $accessEndDate; |
||
| 145 | |||
| 146 | /** |
||
| 147 | * @var \DateTime |
||
| 148 | * |
||
| 149 | * @ORM\Column(name="coach_access_start_date", type="datetime", nullable=true, unique=false) |
||
| 150 | */ |
||
| 151 | private $coachAccessStartDate; |
||
| 152 | |||
| 153 | /** |
||
| 154 | * @var \DateTime |
||
| 155 | * |
||
| 156 | * @ORM\Column(name="coach_access_end_date", type="datetime", nullable=true, unique=false) |
||
| 157 | */ |
||
| 158 | private $coachAccessEndDate; |
||
| 159 | |||
| 160 | /** |
||
| 161 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CItemProperty", mappedBy="session") |
||
| 162 | **/ |
||
| 163 | //private $items; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", inversedBy="sessionAsGeneralCoach") |
||
| 167 | * @ORM\JoinColumn(name="id_coach", referencedColumnName="id") |
||
| 168 | **/ |
||
| 169 | private $generalCoach; |
||
| 170 | |||
| 171 | /** |
||
| 172 | * @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\SessionCategory", inversedBy="session") |
||
| 173 | * @ORM\JoinColumn(name="session_category_id", referencedColumnName="id") |
||
| 174 | **/ |
||
| 175 | private $category; |
||
| 176 | |||
| 177 | /** |
||
| 178 | * @var ArrayCollection |
||
| 179 | * @ORM\OneToMany(targetEntity="SessionRelCourse", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 180 | **/ |
||
| 181 | protected $courses; |
||
| 182 | |||
| 183 | /** |
||
| 184 | * @var ArrayCollection |
||
| 185 | * @ORM\OneToMany(targetEntity="SessionRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 186 | **/ |
||
| 187 | protected $users; |
||
| 188 | |||
| 189 | /** |
||
| 190 | * @var ArrayCollection |
||
| 191 | * @ORM\OneToMany(targetEntity="SessionRelCourseRelUser", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 192 | **/ |
||
| 193 | protected $userCourseSubscriptions; |
||
| 194 | |||
| 195 | /** |
||
| 196 | * @var Course |
||
| 197 | **/ |
||
| 198 | protected $currentCourse; |
||
| 199 | |||
| 200 | /** |
||
| 201 | * @var boolean |
||
| 202 | * @ORM\Column(name="send_subscription_notification", type="boolean", nullable=false, options={"default":false}) |
||
| 203 | */ |
||
| 204 | private $sendSubscriptionNotification; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * @var ArrayCollection |
||
| 208 | * @ORM\OneToMany(targetEntity="Chamilo\CourseBundle\Entity\CStudentPublication", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 209 | */ |
||
| 210 | private $studentPublications; |
||
| 211 | |||
| 212 | /** |
||
| 213 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\SkillRelUser", mappedBy="session", cascade={"persist"}) |
||
| 214 | */ |
||
| 215 | protected $issuedSkills; |
||
| 216 | |||
| 217 | /** |
||
| 218 | * @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\AccessUrlRelSession", mappedBy="session", cascade={"persist"}, orphanRemoval=true) |
||
| 219 | **/ |
||
| 220 | protected $urls; |
||
| 221 | |||
| 222 | /** |
||
| 223 | * @var AccessUrl |
||
| 224 | **/ |
||
| 225 | protected $currentUrl; |
||
| 226 | |||
| 227 | /** |
||
| 228 | * Constructor |
||
| 229 | */ |
||
| 230 | public function __construct() |
||
| 254 | |||
| 255 | /** |
||
| 256 | * @return int |
||
| 257 | */ |
||
| 258 | public function getDuration() |
||
| 262 | |||
| 263 | /** |
||
| 264 | * @param int $duration |
||
| 265 | */ |
||
| 266 | public function setDuration($duration) |
||
| 270 | |||
| 271 | /** |
||
| 272 | * @return string |
||
| 273 | */ |
||
| 274 | public function getShowDescription() |
||
| 278 | |||
| 279 | /** |
||
| 280 | * @param string $showDescription |
||
| 281 | * @return $this |
||
| 282 | */ |
||
| 283 | public function setShowDescription($showDescription) |
||
| 289 | |||
| 290 | /** |
||
| 291 | * @return string |
||
| 292 | */ |
||
| 293 | public function __toString() |
||
| 297 | |||
| 298 | /** |
||
| 299 | * Get id |
||
| 300 | * |
||
| 301 | * @return integer |
||
| 302 | */ |
||
| 303 | public function getId() |
||
| 307 | |||
| 308 | /** |
||
| 309 | * @param int $id |
||
| 310 | */ |
||
| 311 | public function setId($id) |
||
| 315 | |||
| 316 | /** |
||
| 317 | * @return ArrayCollection |
||
| 318 | */ |
||
| 319 | public function getUsers() |
||
| 323 | |||
| 324 | /** |
||
| 325 | * @param $users |
||
| 326 | * @return $this |
||
| 327 | */ |
||
| 328 | public function setUsers($users) |
||
| 338 | |||
| 339 | /** |
||
| 340 | * @param SessionRelUser $user |
||
| 341 | */ |
||
| 342 | public function addUser(SessionRelUser $user) |
||
| 350 | |||
| 351 | /** |
||
| 352 | * @param int $status |
||
| 353 | * @param User $user |
||
| 354 | */ |
||
| 355 | public function addUserInSession($status, User $user) |
||
| 364 | |||
| 365 | /** |
||
| 366 | * @param SessionRelUser $subscription |
||
| 367 | * @return bool |
||
| 368 | */ |
||
| 369 | View Code Duplication | public function hasUser(SessionRelUser $subscription) |
|
| 387 | |||
| 388 | /** |
||
| 389 | * @return ArrayCollection |
||
| 390 | */ |
||
| 391 | public function getCourses() |
||
| 395 | |||
| 396 | /** |
||
| 397 | * @param $courses |
||
| 398 | */ |
||
| 399 | public function setCourses($courses) |
||
| 407 | |||
| 408 | /** |
||
| 409 | * @param SessionRelCourse $course |
||
| 410 | */ |
||
| 411 | public function addCourses(SessionRelCourse $course) |
||
| 416 | |||
| 417 | /** |
||
| 418 | * @param Course $course |
||
| 419 | * |
||
| 420 | * @return bool |
||
| 421 | */ |
||
| 422 | public function hasCourse(Course $course) |
||
| 435 | |||
| 436 | |||
| 437 | /** |
||
| 438 | * Remove $course |
||
| 439 | * |
||
| 440 | * @param SessionRelCourse $course |
||
| 441 | */ |
||
| 442 | public function removeCourses($course) |
||
| 450 | |||
| 451 | /** |
||
| 452 | * @param User $user |
||
| 453 | * @param Course $course |
||
| 454 | * @param int $status if not set it will check if the user is registered |
||
| 455 | * with any status |
||
| 456 | * |
||
| 457 | * @return bool |
||
| 458 | */ |
||
| 459 | public function hasUserInCourse(User $user, Course $course, $status = null) |
||
| 465 | |||
| 466 | /** |
||
| 467 | * @param User $user |
||
| 468 | * @param Course $course |
||
| 469 | * |
||
| 470 | * @return bool |
||
| 471 | */ |
||
| 472 | public function hasStudentInCourse(User $user, Course $course) |
||
| 476 | |||
| 477 | /** |
||
| 478 | * @param User $user |
||
| 479 | * @param Course $course |
||
| 480 | * |
||
| 481 | * @return bool |
||
| 482 | */ |
||
| 483 | public function hasCoachInCourseWithStatus(User $user, Course $course) |
||
| 487 | |||
| 488 | /** |
||
| 489 | * @param User $user |
||
| 490 | * @param Course $course |
||
| 491 | * @param string $status |
||
| 492 | * |
||
| 493 | * @return \Doctrine\Common\Collections\Collection|static |
||
| 494 | */ |
||
| 495 | public function getUserInCourse(User $user, Course $course, $status = null) |
||
| 511 | |||
| 512 | /** |
||
| 513 | * Set name |
||
| 514 | * |
||
| 515 | * @param string $name |
||
| 516 | * @return Session |
||
| 517 | */ |
||
| 518 | public function setName($name) |
||
| 524 | |||
| 525 | /** |
||
| 526 | * Get name |
||
| 527 | * |
||
| 528 | * @return string |
||
| 529 | */ |
||
| 530 | public function getName() |
||
| 534 | |||
| 535 | /** |
||
| 536 | * Set description |
||
| 537 | * |
||
| 538 | * @param string $description |
||
| 539 | * @return Session |
||
| 540 | */ |
||
| 541 | public function setDescription($description) |
||
| 547 | |||
| 548 | /** |
||
| 549 | * Get description |
||
| 550 | * |
||
| 551 | * @return string |
||
| 552 | */ |
||
| 553 | public function getDescription() |
||
| 557 | |||
| 558 | /** |
||
| 559 | * Set nbrCourses |
||
| 560 | * |
||
| 561 | * @param integer $nbrCourses |
||
| 562 | * @return Session |
||
| 563 | */ |
||
| 564 | public function setNbrCourses($nbrCourses) |
||
| 570 | |||
| 571 | /** |
||
| 572 | * Get nbrCourses |
||
| 573 | * |
||
| 574 | * @return integer |
||
| 575 | */ |
||
| 576 | public function getNbrCourses() |
||
| 580 | |||
| 581 | /** |
||
| 582 | * Set nbrUsers |
||
| 583 | * |
||
| 584 | * @param integer $nbrUsers |
||
| 585 | * @return Session |
||
| 586 | */ |
||
| 587 | public function setNbrUsers($nbrUsers) |
||
| 593 | |||
| 594 | /** |
||
| 595 | * Get nbrUsers |
||
| 596 | * |
||
| 597 | * @return integer |
||
| 598 | */ |
||
| 599 | public function getNbrUsers() |
||
| 603 | |||
| 604 | /** |
||
| 605 | * Set nbrClasses |
||
| 606 | * |
||
| 607 | * @param integer $nbrClasses |
||
| 608 | * @return Session |
||
| 609 | */ |
||
| 610 | public function setNbrClasses($nbrClasses) |
||
| 616 | |||
| 617 | /** |
||
| 618 | * Get nbrClasses |
||
| 619 | * |
||
| 620 | * @return integer |
||
| 621 | */ |
||
| 622 | public function getNbrClasses() |
||
| 626 | |||
| 627 | /** |
||
| 628 | * Set sessionAdminId |
||
| 629 | * |
||
| 630 | * @param integer $sessionAdminId |
||
| 631 | * @return Session |
||
| 632 | */ |
||
| 633 | public function setSessionAdminId($sessionAdminId) |
||
| 639 | |||
| 640 | /** |
||
| 641 | * Get sessionAdminId |
||
| 642 | * |
||
| 643 | * @return integer |
||
| 644 | */ |
||
| 645 | public function getSessionAdminId() |
||
| 649 | |||
| 650 | /** |
||
| 651 | * Set visibility |
||
| 652 | * |
||
| 653 | * @param integer $visibility |
||
| 654 | * @return Session |
||
| 655 | */ |
||
| 656 | public function setVisibility($visibility) |
||
| 662 | |||
| 663 | /** |
||
| 664 | * Get visibility |
||
| 665 | * |
||
| 666 | * @return integer |
||
| 667 | */ |
||
| 668 | public function getVisibility() |
||
| 672 | |||
| 673 | /** |
||
| 674 | * Set promotionId |
||
| 675 | * |
||
| 676 | * @param integer $promotionId |
||
| 677 | * @return Session |
||
| 678 | */ |
||
| 679 | public function setPromotionId($promotionId) |
||
| 685 | |||
| 686 | /** |
||
| 687 | * Get promotionId |
||
| 688 | * |
||
| 689 | * @return integer |
||
| 690 | */ |
||
| 691 | public function getPromotionId() |
||
| 695 | |||
| 696 | /** |
||
| 697 | * Set displayStartDate |
||
| 698 | * |
||
| 699 | * @param \DateTime $displayStartDate |
||
| 700 | * @return Session |
||
| 701 | */ |
||
| 702 | public function setDisplayStartDate($displayStartDate) |
||
| 708 | |||
| 709 | /** |
||
| 710 | * Get displayStartDate |
||
| 711 | * |
||
| 712 | * @return \DateTime |
||
| 713 | */ |
||
| 714 | public function getDisplayStartDate() |
||
| 718 | |||
| 719 | /** |
||
| 720 | * Set displayEndDate |
||
| 721 | * |
||
| 722 | * @param \DateTime $displayEndDate |
||
| 723 | * @return Session |
||
| 724 | */ |
||
| 725 | public function setDisplayEndDate($displayEndDate) |
||
| 731 | |||
| 732 | /** |
||
| 733 | * Get displayEndDate |
||
| 734 | * |
||
| 735 | * @return \DateTime |
||
| 736 | */ |
||
| 737 | public function getDisplayEndDate() |
||
| 741 | |||
| 742 | /** |
||
| 743 | * Set accessStartDate |
||
| 744 | * |
||
| 745 | * @param \DateTime $accessStartDate |
||
| 746 | * @return Session |
||
| 747 | */ |
||
| 748 | public function setAccessStartDate($accessStartDate) |
||
| 754 | |||
| 755 | /** |
||
| 756 | * Get accessStartDate |
||
| 757 | * |
||
| 758 | * @return \DateTime |
||
| 759 | */ |
||
| 760 | public function getAccessStartDate() |
||
| 764 | |||
| 765 | /** |
||
| 766 | * Set accessEndDate |
||
| 767 | * |
||
| 768 | * @param \DateTime $accessEndDate |
||
| 769 | * @return Session |
||
| 770 | */ |
||
| 771 | public function setAccessEndDate($accessEndDate) |
||
| 777 | |||
| 778 | /** |
||
| 779 | * Get accessEndDate |
||
| 780 | * |
||
| 781 | * @return \DateTime |
||
| 782 | */ |
||
| 783 | public function getAccessEndDate() |
||
| 787 | |||
| 788 | /** |
||
| 789 | * Set coachAccessStartDate |
||
| 790 | * |
||
| 791 | * @param \DateTime $coachAccessStartDate |
||
| 792 | * @return Session |
||
| 793 | */ |
||
| 794 | public function setCoachAccessStartDate($coachAccessStartDate) |
||
| 800 | |||
| 801 | /** |
||
| 802 | * Get coachAccessStartDate |
||
| 803 | * |
||
| 804 | * @return \DateTime |
||
| 805 | */ |
||
| 806 | public function getCoachAccessStartDate() |
||
| 810 | |||
| 811 | /** |
||
| 812 | * Set coachAccessEndDate |
||
| 813 | * |
||
| 814 | * @param \DateTime $coachAccessEndDate |
||
| 815 | * @return Session |
||
| 816 | */ |
||
| 817 | public function setCoachAccessEndDate($coachAccessEndDate) |
||
| 823 | |||
| 824 | /** |
||
| 825 | * Get coachAccessEndDate |
||
| 826 | * |
||
| 827 | * @return \DateTime |
||
| 828 | */ |
||
| 829 | public function getCoachAccessEndDate() |
||
| 833 | |||
| 834 | /** |
||
| 835 | * Get id |
||
| 836 | * |
||
| 837 | * @return User |
||
| 838 | */ |
||
| 839 | public function getGeneralCoach() |
||
| 843 | |||
| 844 | /** |
||
| 845 | * @param $coach |
||
| 846 | * @return $this |
||
| 847 | */ |
||
| 848 | public function setGeneralCoach($coach) |
||
| 854 | |||
| 855 | /** |
||
| 856 | * @return mixed |
||
| 857 | */ |
||
| 858 | public function getCategory() |
||
| 862 | |||
| 863 | /** |
||
| 864 | * @param $category |
||
| 865 | * @return $this |
||
| 866 | */ |
||
| 867 | public function setCategory($category) |
||
| 873 | |||
| 874 | /** |
||
| 875 | * @return array |
||
| 876 | */ |
||
| 877 | public static function getStatusList() |
||
| 886 | |||
| 887 | /** |
||
| 888 | * Check if session is visible |
||
| 889 | * @return bool |
||
| 890 | */ |
||
| 891 | public function isActive() |
||
| 902 | |||
| 903 | /** |
||
| 904 | * @param Course $course |
||
| 905 | */ |
||
| 906 | public function addCourse(Course $course) |
||
| 912 | |||
| 913 | /** |
||
| 914 | * @return ArrayCollection |
||
| 915 | */ |
||
| 916 | public function getUserCourseSubscriptions() |
||
| 920 | |||
| 921 | /** |
||
| 922 | * @param ArrayCollection $userCourseSubscriptions |
||
| 923 | */ |
||
| 924 | public function setUserCourseSubscriptions($userCourseSubscriptions) |
||
| 932 | |||
| 933 | /** |
||
| 934 | * @param SessionRelCourseRelUser $subscription |
||
| 935 | */ |
||
| 936 | public function addUserCourseSubscription(SessionRelCourseRelUser $subscription) |
||
| 943 | |||
| 944 | /** |
||
| 945 | * @param int $status |
||
| 946 | * @param User $user |
||
| 947 | * @param Course $course |
||
| 948 | */ |
||
| 949 | public function addUserInCourse($status, User $user, Course $course) |
||
| 958 | |||
| 959 | /** |
||
| 960 | * @param SessionRelCourseRelUser $subscription |
||
| 961 | * @return bool |
||
| 962 | */ |
||
| 963 | View Code Duplication | public function hasUserCourseSubscription(SessionRelCourseRelUser $subscription) |
|
| 980 | |||
| 981 | /** |
||
| 982 | * @return Course |
||
| 983 | */ |
||
| 984 | public function getCurrentCourse() |
||
| 988 | |||
| 989 | /** |
||
| 990 | * @param Course $course |
||
| 991 | * @return $this |
||
| 992 | */ |
||
| 993 | public function setCurrentCourse(Course $course) |
||
| 1002 | |||
| 1003 | /** |
||
| 1004 | * Set $sendSubscriptionNotification |
||
| 1005 | * @param boolean $sendNotification |
||
| 1006 | * @return Session |
||
| 1007 | */ |
||
| 1008 | public function setSendSubscriptionNotification($sendNotification) |
||
| 1014 | |||
| 1015 | /** |
||
| 1016 | * Get $sendSubscriptionNotification |
||
| 1017 | * @return boolean |
||
| 1018 | */ |
||
| 1019 | public function getSendSubscriptionNotification() |
||
| 1023 | |||
| 1024 | /** |
||
| 1025 | * Get user from course by status |
||
| 1026 | * @param \Chamilo\CoreBundle\Entity\Course $course |
||
| 1027 | * @param string $status |
||
| 1028 | * @return \Doctrine\Common\Collections\Collection|static |
||
| 1029 | */ |
||
| 1030 | public function getUserCourseSubscriptionsByStatus(Course $course, $status) |
||
| 1042 | |||
| 1043 | public function getBuyCoursePluginPrice() |
||
| 1062 | |||
| 1063 | /** |
||
| 1064 | * @param ArrayCollection $studentPublications |
||
| 1065 | * @return Session |
||
| 1066 | */ |
||
| 1067 | public function setStudentPublications(ArrayCollection $studentPublications) |
||
| 1077 | |||
| 1078 | /** |
||
| 1079 | * @param CStudentPublication $studentPublication |
||
| 1080 | * @return Session |
||
| 1081 | */ |
||
| 1082 | public function addStudentPublication(CStudentPublication $studentPublication) |
||
| 1088 | |||
| 1089 | /** |
||
| 1090 | * Get studentPublications |
||
| 1091 | * @return ArrayCollection |
||
| 1092 | */ |
||
| 1093 | public function getStudentPublications() |
||
| 1097 | |||
| 1098 | /** |
||
| 1099 | * Get issuedSkills |
||
| 1100 | * @return ArrayCollection |
||
| 1101 | */ |
||
| 1102 | public function getIssuedSkills() |
||
| 1106 | |||
| 1107 | /** |
||
| 1108 | * @param AccessUrl $url |
||
| 1109 | * |
||
| 1110 | * @return $this |
||
| 1111 | */ |
||
| 1112 | View Code Duplication | public function setCurrentUrl(AccessUrl $url) |
|
| 1125 | |||
| 1126 | /** |
||
| 1127 | * @return AccessUrl |
||
| 1128 | */ |
||
| 1129 | public function getCurrentUrl() |
||
| 1133 | |||
| 1134 | /** |
||
| 1135 | * @return ArrayCollection |
||
| 1136 | */ |
||
| 1137 | public function getUrls() |
||
| 1141 | |||
| 1142 | /** |
||
| 1143 | * @param $urls |
||
| 1144 | */ |
||
| 1145 | public function setUrls($urls) |
||
| 1153 | |||
| 1154 | /** |
||
| 1155 | * @param AccessUrlRelSession $url |
||
| 1156 | */ |
||
| 1157 | public function addUrls(AccessUrlRelSession $url) |
||
| 1162 | } |
||
| 1163 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.