Code Duplication    Length = 14-15 lines in 2 locations

src/Queries/SectionQuery.php 1 location

@@ 145-158 (lines=14) @@
142
     *
143
     * @return int
144
     */
145
    public function count()
146
    {
147
        if ($this->queryShouldBeStopped) {
148
            return 0;
149
        }
150
151
        $queryType = 'SectionQuery::count';
152
        $filter = $this->normalizeFilter();
153
        $callback = function() use ($filter) {
154
            return (int) $this->bxObject->getCount($filter);
155
        };
156
157
        return $this->handleCacheIfNeeded(compact('queryType', 'filter'), $callback);
158
    }
159
160
    /**
161
     * Setter for countElements.

src/Queries/ElementQuery.php 1 location

@@ 221-235 (lines=15) @@
218
     *
219
     * @return int
220
     */
221
    public function count()
222
    {
223
        if ($this->queryShouldBeStopped) {
224
            return 0;
225
        }
226
227
        $filter = $this->normalizeFilter();
228
        $queryType = "ElementQuery::count";
229
230
        $callback = function () use ($filter) {
231
            return (int) $this->bxObject->GetList(false, $filter, []);
232
        };
233
234
        return $this->handleCacheIfNeeded(compact('filter', 'queryType'), $callback);
235
    }
236
237
//    /**
238
//     * Normalize properties's format converting it to 'PROPERTY_"CODE"_VALUE'.