Completed
Push — master ( 0631c4...d19571 )
by Andrii
02:04
created

ActiveQuery   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 1
cbo 2
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A count() 0 9 1
1
<?php
2
/**
3
 * Libraries.io API implementation for yii2-hiart.
4
 *
5
 * @link      https://github.com/hiqdev/yii2-hiart-librariesio
6
 * @package   yii2-hiart-librariesio
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hiqdev\hiart\librariesio;
12
13
/**
14
 * Libraries.io API implementation.
15
 *
16
 * @author Andrii Vasyliev <[email protected]>
17
 */
18
class ActiveQuery extends \hiqdev\hiart\ActiveQuery
19
{
20 1
    public function count($q = '*', $db = null)
21
    {
22 1
        $this->count = $q;
23
24 1
        $response = $this->limit(1)->searchBatch($db);
25 1
        $totals = $response->getHeader('total');
26
27 1
        return reset($totals);
28
    }
29
}
30