Code Duplication    Length = 9-9 lines in 2 locations

src/Chamilo/CoreBundle/Security/Authorization/Voter/SessionVoter.php 2 locations

@@ 112-120 (lines=9) @@
109
            case self::VIEW:
110
                // General coach
111
                $generalCoach = $session->getGeneralCoach();
112
                if ($generalCoach) {
113
                    $coachId = $generalCoach->getId();
114
                    $userId = $user->getId();
115
                    if ($coachId == $userId) {
116
                        $user->addRole('ROLE_CURRENT_SESSION_COURSE_TEACHER');
117
118
                        return true;
119
                    }
120
                }
121
122
                // Course-Coach access
123
                if ($session->hasCoachInCourseWithStatus($user, $course)) {
@@ 188-196 (lines=9) @@
185
            case self::DELETE:
186
                // General coach check
187
                $generalCoach = $session->getGeneralCoach();
188
                if ($generalCoach) {
189
                    $coachId = $generalCoach->getId();
190
                    $userId = $user->getId();
191
                    if ($coachId == $userId) {
192
                        $user->addRole('ROLE_CURRENT_SESSION_COURSE_TEACHER');
193
194
                        return true;
195
                    }
196
                }
197
198
                // Course session check
199
                if ($session->hasCoachInCourseWithStatus($user, $course)) {