Code Duplication    Length = 10-10 lines in 2 locations

src/Controller/Frontend/PostVoteController.php 1 location

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

src/Controller/Frontend/GameController.php 1 location

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