Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 602-611 (lines=10) @@
599
        // buildView must be before sendMail because it adds the game template path to the templateStack
600
        $viewModel = $this->buildView($this->game);
601
602
        if ($this->getRequest()->isPost()) {
603
            $data = $this->getRequest()->getPost()->toArray();
604
            $form->setData($data);
605
            if ($form->isValid()) {
606
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
607
                if ($result) {
608
                    $statusMail = true;
609
                }
610
            }
611
        }
612
613
        $viewModel->setVariables(array(
614
                'statusMail' => $statusMail,

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

@@ 942-951 (lines=10) @@
939
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
940
        $form->setAttribute('method', 'post');
941
    
942
        if ($this->getRequest()->isPost()) {
943
            $data = $this->getRequest()->getPost()->toArray();
944
            $form->setData($data);
945
            if ($form->isValid()) {
946
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
947
                if ($result) {
948
                    $statusMail = true;
949
                }
950
            }
951
        }
952
953
        $viewModel = $this->buildView($this->game);
954