Code Duplication    Length = 4-9 lines in 4 locations

src/AppBundle/Controller/SimpleEditCounterController.php 1 location

@@ 122-125 (lines=4) @@
119
        $resultQuery->bindParam('username', $usernameParam);
120
        $resultQuery->execute();
121
122
        if ($resultQuery->errorCode() > 0) {
123
            $this->addFlash('notice', [ 'no-result', $username ]);
124
            return $this->redirectToRoute('SimpleEditCounterProject', [ 'project' => $project->getDomain() ]);
125
        }
126
127
        // Fetch the result data
128
        $results = $resultQuery->fetchAll();

src/AppBundle/Controller/EditSummaryController.php 1 location

@@ 182-190 (lines=9) @@
179
        }
180
        $resultQuery->execute();
181
182
        if ($resultQuery->errorCode() > 0) {
183
            $this->addFlash('notice', ['no-result', $username]);
184
            return $this->redirectToRoute(
185
                'EditSummaryProject',
186
                [
187
                    'project' => $project->getDomain()
188
                ]
189
            );
190
        }
191
192
        // Set defaults, so we don't get variable undefined errors
193
        $totalSummariesMajor = 0;

src/AppBundle/Controller/RfXAnalysisController.php 2 locations

@@ 149-157 (lines=9) @@
146
147
        $text = $page->getWikitext();
148
149
        if (!isset($text)) {
150
            $this->addFlash('notice', ['no-result', $pagename]);
151
            return $this->redirectToRoute(
152
                'rfxAnalysisProject',
153
                [
154
                    'project' => $projectData->getDatabaseName()
155
                ]
156
            );
157
        }
158
159
        $rfx = new RFX(
160
            $text,
@@ 171-179 (lines=9) @@
168
169
        $total = count($support) + count($oppose) + count($neutral);
170
171
        if ($total === 0) {
172
            $this->addFlash('notice', ['no-result', $pagename]);
173
            return $this->redirectToRoute(
174
                'rfxAnalysisProject',
175
                [
176
                    'project' => $projectData->getDatabaseName(),
177
                ]
178
            );
179
        }
180
181
        $end = $rfx->getEndDate();
182