Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 899-908 (lines=10) @@
896
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
897
        $form->setAttribute('method', 'post');
898
    
899
        if ($this->getRequest()->isPost()) {
900
            $data = $this->getRequest()->getPost()->toArray();
901
            $form->setData($data);
902
            if ($form->isValid()) {
903
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
904
                if ($result) {
905
                    $statusMail = true;
906
                }
907
            }
908
        }
909
910
        $viewModel = $this->buildView($this->game);
911
    

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

@@ 562-571 (lines=10) @@
559
        // buildView must be before sendMail because it adds the game template path to the templateStack
560
        $viewModel = $this->buildView($this->game);
561
    
562
        if ($this->getRequest()->isPost()) {
563
            $data = $this->getRequest()->getPost()->toArray();
564
            $form->setData($data);
565
            if ($form->isValid()) {
566
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
567
                if ($result) {
568
                    $statusMail = true;
569
                }
570
            }
571
        }
572
573
        $viewModel->setVariables(array(
574
            'statusMail'       => $statusMail,