Code Duplication    Length = 11-11 lines in 2 locations

src/Chamilo/CourseBundle/Controller/CToolIntroController.php 2 locations

@@ 117-127 (lines=11) @@
114
        $form = $this->createForm($formService, $toolIntro);
115
        $form->handleRequest($request);
116
117
        if ($form->isValid()) {
118
            $em = $this->getDoctrine()->getManager();
119
            $em->persist($toolIntro);
120
            $em->flush();
121
            $this->addFlash('success', $this->trans('Saved'));
122
123
            return $this->redirectToRoute(
124
                'chamilo_course_ctoolintro_update',
125
                ['course' => $course->getCode(), 'iid' => $toolIntro->getId()]
126
            );
127
        }
128
129
        return ['form' => $form->createView(), 'tool' => $tool];
130
    }
@@ 168-178 (lines=11) @@
165
        $tool = $toolIntro->getTool();
166
        $form->handleRequest($request);
167
168
        if ($form->isValid()) {
169
            $em = $this->getDoctrine()->getManager();
170
            $em->persist($toolIntro);
171
            $em->flush();
172
            $this->addFlash('success', $this->trans('Updated'));
173
174
            return $this->redirectToRoute(
175
                'chamilo_course_ctoolintro_update',
176
                ['course' => $course->getCode(), 'tool' => $tool, 'iid' => $iid]
177
            );
178
        }
179
180
        return [
181
            'tool' => $tool,