Code Duplication    Length = 10-10 lines in 2 locations

src/PlaygroundGame/Controller/Frontend/GameController.php 1 location

@@ 554-563 (lines=10) @@
551
        // buildView must be before sendMail because it adds the game template path to the templateStack
552
        $viewModel = $this->buildView($this->game);
553
    
554
        if ($this->getRequest()->isPost()) {
555
            $data = $this->getRequest()->getPost()->toArray();
556
            $form->setData($data);
557
            if ($form->isValid()) {
558
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
559
                if ($result) {
560
                    $statusMail = true;
561
                }
562
            }
563
        }
564
565
        $viewModel->setVariables(array(
566
            'statusMail'       => $statusMail,

src/PlaygroundGame/Controller/Frontend/PostVoteController.php 1 location

@@ 724-733 (lines=10) @@
721
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
722
        $form->setAttribute('method', 'post');
723
    
724
        if ($this->getRequest()->isPost()) {
725
            $data = $this->getRequest()->getPost()->toArray();
726
            $form->setData($data);
727
            if ($form->isValid()) {
728
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
729
                if ($result) {
730
                    $statusMail = true;
731
                }
732
            }
733
        }
734
735
        $viewModel = $this->buildView($this->game);
736