Code Duplication    Length = 6-6 lines in 3 locations

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

@@ 834-839 (lines=6) @@
831
        if ($this->getRequest()->isPost()) {
832
            $data = $this->getRequest()->getPost()->toArray();
833
            $form->setData($data);
834
            if ($form->isValid()) {
835
                $result = $this->getGameService()->sendShareMail($data, $game, $user, $lastEntry);
836
                if ($result) {
837
                    $statusMail = true;
838
                }
839
            }
840
        }
841
    
842
        // buildView must be before sendMail because it adds the game template path to the templateStack

src/PlaygroundGame/Controller/Frontend/PostVoteController.php 2 locations

@@ 447-452 (lines=6) @@
444
        if ($this->getRequest()->isPost()) {
445
            $data = $this->getRequest()->getPost()->toArray();
446
            $form->setData($data);
447
            if ($form->isValid()) {
448
                $result = $this->getGameService()->sendShareMail($data, $game, $this->user, $lastEntry);
449
                if ($result) {
450
                    $statusMail = true;
451
                }
452
            }
453
        }
454
455
        // Je recherche le post associé à entry + status == 0. Si non trouvé, je redirige vers home du jeu.
@@ 820-825 (lines=6) @@
817
        if ($this->getRequest()->isPost()) {
818
            $data = $this->getRequest()->getPost()->toArray();
819
            $form->setData($data);
820
            if ($form->isValid()) {
821
                $result = $this->getGameService()->sendShareMail($data, $game, $this->user, $lastEntry);
822
                if ($result) {
823
                    $statusMail = true;
824
                }
825
            }
826
        }
827
828
        $viewModel = $this->buildView($game);