Code Duplication    Length = 3-6 lines in 3 locations

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

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

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

@@ 101-103 (lines=3) @@
98
            throw new \RuntimeException('Invalid query, can not disable count and request 0 items at the same time');
99
        }
100
101
        if ($limit === 0 || ($count !== null && $count <= $offset)) {
102
            return array('count' => $count, 'rows' => array());
103
        }
104
105
        $selectQuery = $this->handler->createSelectQuery();
106
        $selectQuery->select(

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

@@ 70-75 (lines=6) @@
67
            throw new \RuntimeException('Invalid query, can not 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->createSelectQuery();
78
        $query->where($this->criteriaConverter->convertCriteria($query, $criterion));