Code Duplication    Length = 9-9 lines in 2 locations

Bundle/MediaBundle/Controller/MediaController.php 2 locations

@@ 51-59 (lines=9) @@
48
49
        $form = $this->createForm($handler->getFormType(), $helper);
50
51
        if ('POST' == $request->getMethod()) {
52
            $form->handleRequest($request);
53
            if ($form->isValid()) {
54
                $media = $helper->getMedia();
55
                $em->getRepository('VictoireMediaBundle:Media')->save($media);
56
57
                return new RedirectResponse($this->generateUrl('VictoireMediaBundle_media_show', ['mediaId'  => $media->getId()]));
58
            }
59
        }
60
        $showTemplate = $mediaManager->getHandler($media)->getShowTemplate($media);
61
62
        return $this->render($showTemplate, [
@@ 238-246 (lines=9) @@
235
236
        if ($request->isMethod('POST')) {
237
            $form->handleRequest($request);
238
            if ($form->isValid()) {
239
                $media = $helper->getMedia();
240
                $media->setFolder($folder);
241
                $em->getRepository('VictoireMediaBundle:Media')->save($media);
242
243
                $this->congrat('Media \''.$media->getName().'\' has been created!');
244
245
                return new RedirectResponse($this->generateUrl($redirectUrl, ['folderId' => $folder->getId()]));
246
            }
247
        }
248
249
        return [