Code Duplication    Length = 18-20 lines in 5 locations

src/PlaygroundGame/Controller/Frontend/GameController.php 5 locations

@@ 799-816 (lines=18) @@
796
        return $viewModel;
797
    }
798
799
    public function logoutAction()
800
    {
801
        $viewModel = $this->forward()->dispatch(
802
            'playgrounduser_user',
803
            array(
804
                'controller' => 'playgrounduser_user',
805
                'action' => 'logout',
806
                'id' => $this->game->getIdentifier()
807
            )
808
        );
809
810
        if ($viewModel && $viewModel instanceof \Zend\View\Model\ViewModel) {
811
            $this->layout()->setVariables(array('game' => $this->game));
812
            $viewModel->setVariables(array('game' => $this->game));
813
        }
814
815
        return $viewModel;
816
    }
817
818
    public function userregisterAction()
819
    {
@@ 1046-1063 (lines=18) @@
1043
        return $this->redirect()->toUrl($redirect);
1044
    }
1045
1046
    public function userProfileAction()
1047
    {
1048
        $viewModel = $this->forward()->dispatch(
1049
            'playgrounduser_user',
1050
            array(
1051
                'controller' => 'playgrounduser_user',
1052
                'action' => 'profile',
1053
                'id' => $this->game->getIdentifier()
1054
            )
1055
        );
1056
1057
        if ($viewModel && $viewModel instanceof \Zend\View\Model\ViewModel) {
1058
            $this->layout()->setVariables(array('game' => $this->game));
1059
            $viewModel->setVariables(array('game' => $this->game));
1060
        }
1061
1062
        return $viewModel;
1063
    }
1064
1065
    public function userresetAction()
1066
    {
@@ 1086-1103 (lines=18) @@
1083
        return $viewModel;
1084
    }
1085
1086
    public function ajaxforgotAction()
1087
    {
1088
        $view = $this->forward()->dispatch(
1089
            'playgrounduser_forgot',
1090
            array(
1091
                'controller' => 'playgrounduser_forgot',
1092
                'action' => 'ajaxforgot',
1093
                'id' => $this->game->getIdentifier()
1094
            )
1095
        );
1096
1097
        if ($view && $view instanceof \Zend\View\Model\ViewModel) {
1098
            $this->layout()->setVariables(array('game' => $this->game));
1099
            $view->setVariables(array('game' => $this->game));
1100
        }
1101
1102
        return $view;
1103
    }
1104
1105
    public function cmsPageAction()
1106
    {
@@ 1105-1123 (lines=19) @@
1102
        return $view;
1103
    }
1104
1105
    public function cmsPageAction()
1106
    {
1107
        $viewModel = $this->forward()->dispatch(
1108
            'playgroundcms',
1109
            array(
1110
                'controller' => 'playgroundcms',
1111
                'action' => 'index',
1112
                'id' => $this->game->getIdentifier(),
1113
                'pid' => $this->getEvent()->getRouteMatch()->getParam('pid')
1114
            )
1115
        );
1116
1117
        if ($viewModel && $viewModel instanceof \Zend\View\Model\ViewModel) {
1118
            $this->layout()->setVariables(array('game' => $this->game));
1119
            $viewModel->setVariables(array('game' => $this->game));
1120
        }
1121
1122
        return $viewModel;
1123
    }
1124
1125
    public function cmsListAction()
1126
    {
@@ 1125-1144 (lines=20) @@
1122
        return $viewModel;
1123
    }
1124
1125
    public function cmsListAction()
1126
    {
1127
        $viewModel = $this->forward()->dispatch(
1128
            'playgroundcms',
1129
            array(
1130
                'controller' => 'playgroundcms',
1131
                'action' => 'list',
1132
                'id' => $this->game->getIdentifier(),
1133
                'category' => $this->game->getIdentifier()
1134
            )
1135
        );
1136
1137
        if ($viewModel && $viewModel instanceof \Zend\View\Model\ViewModel) {
1138
            $this->layout()->setVariables(array('game' => $this->game));
1139
            $viewModel->setVariables(array('game' => $this->game));
1140
        }
1141
1142
        return $viewModel;
1143
    }
1144
1145
    /**
1146
     *
1147
     * @param \PlaygroundGame\Entity\Game $game