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

@@ 640-649 (lines=10) @@
637
        // buildView must be before sendMail because it adds the game template path to the templateStack
638
        $viewModel = $this->buildView($this->game);
639
640
        if ($this->getRequest()->isPost()) {
641
            $data = $this->getRequest()->getPost()->toArray();
642
            $form->setData($data);
643
            if ($form->isValid()) {
644
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
645
                if ($result) {
646
                    $statusMail = true;
647
                }
648
            }
649
        }
650
651
        $viewModel->setVariables(array(
652
                'statusMail' => $statusMail,