Code Duplication    Length = 3-6 lines in 3 locations

eZ/Publish/Core/Persistence/Legacy/URL/Gateway/DoctrineDatabase.php 1 location

@@ 70-75 (lines=6) @@
67
            throw new \RuntimeException('Invalid query. Cannot disable count and request 0 items at the same time');
68
        }
69
70
        if ($limit === 0 || ($count !== null && $count <= $offset)) {
71
            return [
72
                'count' => $count,
73
                'rows' => [],
74
            ];
75
        }
76
77
        $query = $this->createSelectDistinctQuery();
78
        $query->where($this->criteriaConverter->convertCriteria($query, $criterion));

eZ/Publish/Core/Search/Legacy/Content/Gateway/DoctrineDatabase.php 1 location

@@ 101-103 (lines=3) @@
98
            throw new \RuntimeException('Invalid query. Cannot disable count and request 0 items at the same time.');
99
        }
100
101
        if ($limit === 0 || ($count !== null && $count <= $offset)) {
102
            return ['count' => $count, 'rows' => []];
103
        }
104
105
        $contentInfoList = $this->getContentInfoList($criterion, $sort, $offset, $limit, $languageFilter);
106

eZ/Publish/Core/Search/Legacy/Content/Location/Gateway/DoctrineDatabase.php 1 location

@@ 95-97 (lines=3) @@
92
            throw new \RuntimeException('Invalid query. Cannot disable count and request 0 items at the same time.');
93
        }
94
95
        if ($limit === 0 || ($count !== null && $count <= $offset)) {
96
            return ['count' => $count, 'rows' => []];
97
        }
98
99
        $selectQuery = $this->handler->createSelectQuery();
100
        $selectQuery->select(