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

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