Code Duplication    Length = 9-12 lines in 2 locations

src/Controller/Frontend/MissionController.php 1 location

@@ 195-206 (lines=12) @@
192
        // With core shortener helper
193
        $socialLinkUrl = $this->shortenUrl()->shortenUrl($socialLinkUrl);
194
195
        if (!$this->user && !$this->game->getAnonymousAllowed()) {
196
            $redirect = urlencode(
197
                $this->frontendUrl()->fromRoute(
198
                    'mission/result',
199
                    array('id' => $this->game->getIdentifier())
200
                )
201
            );
202
203
            return $this->redirect()->toUrl(
204
                $this->frontendUrl()->fromRoute('zfcuser/register').'?redirect='.$redirect
205
            );
206
        }
207
208
        $form = $this->getServiceLocator()->get('playgroundgame_sharemail_form');
209
        $form->setAttribute('method', 'post');

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);