Code Duplication    Length = 10-10 lines in 2 locations

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

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

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

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