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

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