Code Duplication    Length = 10-10 lines in 2 locations

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

@@ 551-560 (lines=10) @@
548
        // buildView must be before sendMail because it adds the game template path to the templateStack
549
        $viewModel = $this->buildView($this->game);
550
    
551
        if ($this->getRequest()->isPost()) {
552
            $data = $this->getRequest()->getPost()->toArray();
553
            $form->setData($data);
554
            if ($form->isValid()) {
555
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
556
                if ($result) {
557
                    $statusMail = true;
558
                }
559
            }
560
        }
561
562
        $viewModel->setVariables(array(
563
            'statusMail'       => $statusMail,

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

@@ 681-690 (lines=10) @@
678
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
679
        $form->setAttribute('method', 'post');
680
    
681
        if ($this->getRequest()->isPost()) {
682
            $data = $this->getRequest()->getPost()->toArray();
683
            $form->setData($data);
684
            if ($form->isValid()) {
685
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
686
                if ($result) {
687
                    $statusMail = true;
688
                }
689
            }
690
        }
691
692
        $viewModel = $this->buildView($this->game);
693