Code Duplication    Length = 9-12 lines in 2 locations

src/Controller/Frontend/PostVoteController.php 1 location

@@ 125-133 (lines=9) @@
122
                $data = $form->getData();
123
                $post = $this->getGameService()->createPost($data, $this->game, $this->user, $form);
124
125
                if ($post && !empty($this->game->nextStep('play'))) {
126
                    // determine the route where the user should go
127
                    $redirectUrl = $this->frontendUrl()->fromRoute(
128
                        'postvote/'.$this->game->nextStep('play'),
129
                        array('id' => $this->game->getIdentifier())
130
                    );
131
132
                    return $this->redirect()->toUrl($redirectUrl);
133
                }
134
            } else {
135
                $messages = $form->getMessages();
136
                $viewModel = $this->buildView($this->game);

src/Controller/Frontend/MissionController.php 1 location

@@ 211-222 (lines=12) @@
208
        $subGameIdentifier = $this->getEvent()->getRouteMatch()->getParam('gameId');
209
        $subGame           = $this->getGameService()->checkGame($subGameIdentifier);
210
211
        if (!$this->user && !$this->game->getAnonymousAllowed()) {
212
            $redirect = urlencode(
213
                $this->frontendUrl()->fromRoute(
214
                    'mission/result',
215
                    array('id' => $this->game->getIdentifier())
216
                )
217
            );
218
219
            return $this->redirect()->toUrl(
220
                $this->frontendUrl()->fromRoute('zfcuser/register').'?redirect='.$redirect
221
            );
222
        }
223
224
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
225
        $form->setAttribute('method', 'post');