Code Duplication    Length = 15-15 lines in 2 locations

src/Controller/Admin/MemoryController.php 1 location

@@ 194-208 (lines=15) @@
191
        );
192
    }
193
194
    public function removeCardAction()
195
    {
196
        $service = $this->getAdminGameService();
197
        $cardId = $this->getEvent()->getRouteMatch()->getParam('cardId');
198
        if (!$cardId) {
199
            return $this->redirect()->toUrl($this->adminUrl()->fromRoute('playgroundgame/list'));
200
        }
201
        $card = $service->getMemoryCardMapper()->findById($cardId);
202
        $memoryId = $card->getGame()->getId();
203
204
        $service->getMemoryCardMapper()->remove($card);
205
        $this->flashMessenger()->setNamespace('playgroundgame')->addMessage('The card has been deleted');
206
207
        return $this->redirect()->toUrl($this->adminUrl()->fromRoute('playgroundgame/memory-card-list', array('gameId' => $memoryId)));
208
    }
209
210
    public function getAdminGameService()
211
    {

src/Controller/Admin/QuizController.php 1 location

@@ 139-153 (lines=15) @@
136
        return $viewModel->setVariables(array('form' => $form, 'quiz_id' => $quizId, 'question_id' => $questionId));
137
    }
138
139
    public function removeQuestionAction()
140
    {
141
        $service = $this->getAdminGameService();
142
        $questionId = $this->getEvent()->getRouteMatch()->getParam('questionId');
143
        if (!$questionId) {
144
            return $this->redirect()->toUrl($this->adminUrl()->fromRoute('playgroundgame/list'));
145
        }
146
        $question   = $service->getQuizQuestionMapper()->findById($questionId);
147
        $quizId     = $question->getQuiz()->getId();
148
149
        $service->getQuizQuestionMapper()->remove($question);
150
        $this->flashMessenger()->setNamespace('playgroundgame')->addMessage('The question was created');
151
152
        return $this->redirect()->toUrl($this->adminUrl()->fromRoute('playgroundgame/quiz-question-list', array('quizId'=>$quizId)));
153
    }
154
155
    public function sortQuestionAction()
156
    {