Code Duplication    Length = 12-17 lines in 3 locations

src/Kunstmaan/NodeBundle/Controller/NodeAdminController.php 3 locations

@@ 327-338 (lines=12) @@
324
     *
325
     * @throws AccessDeniedException
326
     */
327
    public function publishAction(Request $request, $id)
328
    {
329
        $this->init($request);
330
        /* @var Node $node */
331
        $node = $this->em->getRepository(Node::class)->find($id);
332
333
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
334
        $request = $this->get('request_stack')->getCurrentRequest();
335
        $this->nodePublisher->chooseHowToPublish($request, $nodeTranslation, $this->translator);
336
337
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId())));
338
    }
339
340
    /**
341
     * @Route(
@@ 355-366 (lines=12) @@
352
     *
353
     * @throws AccessDeniedException
354
     */
355
    public function unPublishAction(Request $request, $id)
356
    {
357
        $this->init($request);
358
        /* @var Node $node */
359
        $node = $this->em->getRepository(Node::class)->find($id);
360
361
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
362
        $request = $this->get('request_stack')->getCurrentRequest();
363
        $this->nodePublisher->chooseHowToUnpublish($request, $nodeTranslation, $this->translator);
364
365
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId())));
366
    }
367
368
    /**
369
     * @Route(
@@ 383-399 (lines=17) @@
380
     *
381
     * @throws AccessDeniedException
382
     */
383
    public function unSchedulePublishAction(Request $request, $id)
384
    {
385
        $this->init($request);
386
387
        /* @var Node $node */
388
        $node = $this->em->getRepository(Node::class)->find($id);
389
390
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
391
        $this->nodePublisher->unSchedulePublish($nodeTranslation);
392
393
        $this->addFlash(
394
            FlashTypes::SUCCESS,
395
            $this->get('translator')->trans('kuma_node.admin.unschedule.flash.success')
396
        );
397
398
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $id)));
399
    }
400
401
    /**
402
     * @Route(