Code Duplication    Length = 7-7 lines in 2 locations

back/src/KI/PonthubBundle/Helper/GlobalStatisticsHelper.php 2 locations

@@ 240-246 (lines=7) @@
237
        // On répartit les entrées
238
        $maxPopMovie = 0;
239
        $maxPopGame = 0;
240
        foreach ($movieYears as $key => $value) {
241
            $id = array_search((int)$value['year'], $yearCategories);
242
            $yearSeries[0]['data'][$id] = -$value[1];
243
244
            if ($value[1] > $maxPopMovie)
245
                $maxPopMovie = (int)$value[1];
246
        }
247
        foreach ($gameYears as $key => $value) {
248
            $id = array_search((int)$value['year'], $yearCategories);
249
            $yearSeries[1]['data'][$id] = (int)$value[1];
@@ 247-253 (lines=7) @@
244
            if ($value[1] > $maxPopMovie)
245
                $maxPopMovie = (int)$value[1];
246
        }
247
        foreach ($gameYears as $key => $value) {
248
            $id = array_search((int)$value['year'], $yearCategories);
249
            $yearSeries[1]['data'][$id] = (int)$value[1];
250
251
            if ($value[1] > $maxPopGame)
252
                $maxPopGame = (int)$value[1];
253
        }
254
255
        return [
256
            'categories' => $yearCategories,