Code Duplication    Length = 12-15 lines in 2 locations

src/Queries/D7Query.php 1 location

@@ 71-82 (lines=12) @@
68
     *
69
     * @return int
70
     */
71
    public function count()
72
    {
73
        $className = $this->bxObject->getClassName();
74
        $queryType = 'D7Query::count';
75
        $filter = $this->filter;
76
77
        $callback = function () use ($filter) {
78
            return (int) $this->bxObject->getCount($filter);
79
        };
80
81
        return $this->handleCacheIfNeeded(compact('className', 'filter', 'queryType'), $callback);
82
    }
83
    
84
    /**
85
     * Get list of items.

src/Queries/ElementQuery.php 1 location

@@ 232-246 (lines=15) @@
229
     *
230
     * @return int
231
     */
232
    public function count()
233
    {
234
        if ($this->queryShouldBeStopped) {
235
            return 0;
236
        }
237
238
        $filter = $this->normalizeFilter();
239
        $queryType = "ElementQuery::count";
240
241
        $callback = function () use ($filter) {
242
            return (int) $this->bxObject->GetList(false, $filter, []);
243
        };
244
245
        return $this->handleCacheIfNeeded(compact('filter', 'queryType'), $callback);
246
    }
247
    
248
    /**
249
     * Normalize properties's format converting it to 'PROPERTY_"CODE"_VALUE'.