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

@@ 593-602 (lines=10) @@
590
        // buildView must be before sendMail because it adds the game template path to the templateStack
591
        $viewModel = $this->buildView($this->game);
592
593
        if ($this->getRequest()->isPost()) {
594
            $data = $this->getRequest()->getPost()->toArray();
595
            $form->setData($data);
596
            if ($form->isValid()) {
597
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
598
                if ($result) {
599
                    $statusMail = true;
600
                }
601
            }
602
        }
603
604
        $viewModel->setVariables(array(
605
                'statusMail' => $statusMail,