Code Duplication    Length = 8-8 lines in 2 locations

eZ/Publish/Core/Persistence/Legacy/Content/Gateway/DoctrineDatabase.php 2 locations

@@ 1240-1247 (lines=8) @@
1237
1238
        $results = [];
1239
        $previousId = null;
1240
        foreach ($statement->fetchAll(\PDO::FETCH_ASSOC) as $row) {
1241
            if ($row['ezcontentobject_version_id'] == $previousId) {
1242
                continue;
1243
            }
1244
1245
            $previousId = $row['ezcontentobject_version_id'];
1246
            $results[] = $row;
1247
        }
1248
1249
        return $results;
1250
    }
@@ 2360-2367 (lines=8) @@
2357
    {
2358
        $results = [];
2359
        $previousId = null;
2360
        foreach ($query->execute()->fetchAll(FetchMode::ASSOCIATIVE) as $row) {
2361
            if ($row['ezcontentobject_version_id'] == $previousId) {
2362
                continue;
2363
            }
2364
2365
            $previousId = $row['ezcontentobject_version_id'];
2366
            $results[] = $row;
2367
        }
2368
2369
        return $results;
2370
    }