Code Duplication    Length = 6-6 lines in 3 locations

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

@@ 496-501 (lines=6) @@
493
        if ($this->getRequest()->isPost()) {
494
            $data = $this->getRequest()->getPost()->toArray();
495
            $form->setData($data);
496
            if ($form->isValid()) {
497
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
498
                if ($result) {
499
                    $statusMail = true;
500
                }
501
            }
502
        }
503
    
504
        // buildView must be before sendMail because it adds the game template path to the templateStack

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

@@ 353-358 (lines=6) @@
350
        if ($this->getRequest()->isPost()) {
351
            $data = $this->getRequest()->getPost()->toArray();
352
            $form->setData($data);
353
            if ($form->isValid()) {
354
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
355
                if ($result) {
356
                    $statusMail = true;
357
                }
358
            }
359
        }
360
361
        // Je recherche le post associé à entry + status == 0. Si non trouvé, je redirige vers home du jeu.
@@ 697-702 (lines=6) @@
694
        if ($this->getRequest()->isPost()) {
695
            $data = $this->getRequest()->getPost()->toArray();
696
            $form->setData($data);
697
            if ($form->isValid()) {
698
                $result = $this->getGameService()->sendShareMail($data, $this->game, $this->user, $lastEntry);
699
                if ($result) {
700
                    $statusMail = true;
701
                }
702
            }
703
        }
704
705
        $viewModel = $this->buildView($this->game);