DashboardQuery   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 36
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A enabled() 0 4 1
A orderBySort() 0 4 1
A all() 0 4 1
A one() 0 4 1
1
<?php
2
3
namespace cornernote\dashboard\models\query;
4
5
use yii\db\ActiveQuery;
6
use cornernote\dashboard\models\Dashboard;
7
8
/**
9
 * This is the ActiveQuery class for [[\cornernote\dashboard\models\Dashboard]].
10
 *
11
 * @see Dashboard
12
 */
13
class DashboardQuery extends ActiveQuery
14
{
15
    /**
16
     * @return static
17
     */
18
    public function enabled()
19
    {
20
        return $this->andWhere(['enabled' => 1]);
21
    }
22
23
    /**
24
     * @return static
25
     */
26
    public function orderBySort()
27
    {
28
        return $this->orderBy(['sort' => SORT_ASC]);
29
    }
30
31
    /**
32
     * @inheritdoc
33
     * @return Dashboard[]|array
34
     */
35
    public function all($db = null)
36
    {
37
        return parent::all($db);
38
    }
39
40
    /**
41
     * @inheritdoc
42
     * @return Dashboard|null
43
     */
44
    public function one($db = null)
45
    {
46
        return parent::one($db);
0 ignored issues
show
Bug Compatibility introduced by
The expression parent::one($db); of type yii\db\ActiveRecord|array|null adds the type yii\db\ActiveRecord to the return on line 46 which is incompatible with the return type declared by the interface yii\db\QueryInterface::one of type array|boolean.
Loading history...
47
    }
48
}