Code Duplication    Length = 11-11 lines in 4 locations

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

@@ 63-73 (lines=11) @@
60
61
        if (!$entry) {
62
            $lastEntry = $sg->findLastInactiveEntry($game, $user);
63
            if ($lastEntry === null) {
64
                return $this->redirect()->toUrl(
65
                    $this->frontendUrl()->fromRoute(
66
                        'postvote',
67
                        array(
68
                            'id' => $identifier,
69
                            
70
                        )
71
                    )
72
                );
73
            }
74
75
            $lastEntryId = $lastEntry->getId();
76
            $lastPost = $sg->getPostVotePostMapper()->findOneBy(array('entry' => $lastEntryId));
@@ 408-418 (lines=11) @@
405
        // Has the user finished the game ?
406
        $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $user);
407
408
        if ($lastEntry === null) {
409
            return $this->redirect()->toUrl(
410
                $this->frontendUrl()->fromRoute(
411
                    'postvote',
412
                    array(
413
                        'id' => $identifier,
414
                        
415
                    )
416
                )
417
            );
418
        }
419
420
        if (!$user && !$game->getAnonymousAllowed()) {
421
            $redirect = urlencode(
@@ 794-804 (lines=11) @@
791
        // Has the user finished the game ?
792
        $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $user);
793
    
794
        if ($lastEntry === null) {
795
            return $this->redirect()->toUrl(
796
                $this->frontendUrl()->fromRoute(
797
                    'postvote',
798
                    array(
799
                        'id' => $identifier,
800
                        
801
                    )
802
                )
803
            );
804
        }
805
    
806
        $post = $sg->getPostVotePostMapper()->findOneBy(array('entry' => $lastEntry));
807
    

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

@@ 798-808 (lines=11) @@
795
        // Has the user finished the game ?
796
        $lastEntry = $this->getGameService()->findLastInactiveEntry($game, $user);
797
    
798
        if ($lastEntry === null) {
799
            return $this->redirect()->toUrl(
800
                $this->frontendUrl()->fromRoute(
801
                    'postvote',
802
                    array(
803
                        'id' => $identifier,
804
                        
805
                    )
806
                )
807
            );
808
        }
809
    
810
        if (!$user && !$game->getAnonymousAllowed()) {
811
            $redirect = urlencode(