Code Duplication    Length = 8-8 lines in 2 locations

src/AppBundle/Controller/TopEditsController.php 1 location

@@ 242-249 (lines=8) @@
239
        $totalAdded = 0;
240
        $totalRemoved = 0;
241
        $revisions = [];
242
        foreach ($revisionsData as $revision) {
243
            if ($revision['length_change'] > 0) {
244
                $totalAdded += $revision['length_change'];
245
            } else {
246
                $totalRemoved += $revision['length_change'];
247
            }
248
            $revisions[] = new Edit($page, $revision);
249
        }
250
251
        // Send all to the template.
252
        return $this->render('topedits/result_article.html.twig', [

src/Xtools/Page.php 1 location

@@ 204-211 (lines=8) @@
201
        $totalAdded = 0;
202
        $totalRemoved = 0;
203
        $revisions = [];
204
        foreach ($data as $revision) {
205
            if ($revision['length_change'] > 0) {
206
                $totalAdded += $revision['length_change'];
207
            } else {
208
                $totalRemoved += $revision['length_change'];
209
            }
210
            $revisions[] = $revision;
211
        }
212
        $this->revisions = $revisions;
213
214
        return $revisions;