Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 564-573 (lines=10) @@
561
        // buildView must be before sendMail because it adds the game template path to the templateStack
562
        $viewModel = $this->buildView($this->game);
563
    
564
        if ($this->getRequest()->isPost()) {
565
            $data = $this->getRequest()->getPost()->toArray();
566
            $form->setData($data);
567
            if ($form->isValid()) {
568
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
569
                if ($result) {
570
                    $statusMail = true;
571
                }
572
            }
573
        }
574
575
        $viewModel->setVariables(array(
576
            'statusMail'       => $statusMail,

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

@@ 933-942 (lines=10) @@
930
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
931
        $form->setAttribute('method', 'post');
932
    
933
        if ($this->getRequest()->isPost()) {
934
            $data = $this->getRequest()->getPost()->toArray();
935
            $form->setData($data);
936
            if ($form->isValid()) {
937
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
938
                if ($result) {
939
                    $statusMail = true;
940
                }
941
            }
942
        }
943
944
        $viewModel = $this->buildView($this->game);
945