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

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

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

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