Code Duplication    Length = 10-10 lines in 2 locations

src/Controller/Frontend/PostVoteController.php 1 location

@@ 949-958 (lines=10) @@
946
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
947
        $form->setAttribute('method', 'post');
948
    
949
        if ($this->getRequest()->isPost()) {
950
            $data = $this->getRequest()->getPost()->toArray();
951
            $form->setData($data);
952
            if ($form->isValid()) {
953
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
954
                if ($result) {
955
                    $statusMail = true;
956
                }
957
            }
958
        }
959
960
        $viewModel = $this->buildView($this->game);
961
    

src/Controller/Frontend/GameController.php 1 location

@@ 660-669 (lines=10) @@
657
        // buildView must be before sendMail because it adds the game template path to the templateStack
658
        $viewModel = $this->buildView($this->game);
659
660
        if ($this->getRequest()->isPost()) {
661
            $data = $this->getRequest()->getPost()->toArray();
662
            $form->setData($data);
663
            if ($form->isValid()) {
664
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
665
                if ($result) {
666
                    $statusMail = true;
667
                }
668
            }
669
        }
670
671
        $viewModel->setVariables(
672
            [