Code Duplication    Length = 10-10 lines in 2 locations

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
    

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

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