Code Duplication    Length = 12-17 lines in 3 locations

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

@@ 316-327 (lines=12) @@
313
     *
314
     * @throws AccessDeniedException
315
     */
316
    public function publishAction(Request $request, $id)
317
    {
318
        $this->init($request);
319
        /* @var Node $node */
320
        $node = $this->em->getRepository(Node::class)->find($id);
321
322
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
323
        $request = $this->get('request_stack')->getCurrentRequest();
324
        $this->nodePublisher->chooseHowToPublish($request, $nodeTranslation, $this->translator);
325
326
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId())));
327
    }
328
329
    /**
330
     * @Route(
@@ 344-355 (lines=12) @@
341
     *
342
     * @throws AccessDeniedException
343
     */
344
    public function unPublishAction(Request $request, $id)
345
    {
346
        $this->init($request);
347
        /* @var Node $node */
348
        $node = $this->em->getRepository(Node::class)->find($id);
349
350
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
351
        $request = $this->get('request_stack')->getCurrentRequest();
352
        $this->nodePublisher->chooseHowToUnpublish($request, $nodeTranslation, $this->translator);
353
354
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $node->getId())));
355
    }
356
357
    /**
358
     * @Route(
@@ 372-388 (lines=17) @@
369
     *
370
     * @throws AccessDeniedException
371
     */
372
    public function unSchedulePublishAction(Request $request, $id)
373
    {
374
        $this->init($request);
375
376
        /* @var Node $node */
377
        $node = $this->em->getRepository(Node::class)->find($id);
378
379
        $nodeTranslation = $node->getNodeTranslation($this->locale, true);
380
        $this->nodePublisher->unSchedulePublish($nodeTranslation);
381
382
        $this->addFlash(
383
            FlashTypes::SUCCESS,
384
            $this->get('translator')->trans('kuma_node.admin.unschedule.flash.success')
385
        );
386
387
        return $this->redirect($this->generateUrl('KunstmaanNodeBundle_nodes_edit', array('id' => $id)));
388
    }
389
390
    /**
391
     * @Route(