Code Duplication    Length = 10-10 lines in 2 locations

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
    

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

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