GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

DynamicQuery   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 1
cbo 3
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A behaviors() 0 17 5
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: vadim
5
 * Date: 07.03.16
6
 * Time: 2:11
7
 */
8
9
namespace sibds\components;
10
11
12
use creocoder\nestedsets\NestedSetsQueryBehavior;
13
use sibds\behaviors\TrashQueryBehavior;
14
use yii\db\ActiveQuery;
15
16
class DynamicQuery extends ActiveQuery
17
{
18
    public function behaviors()
19
    {
20
        $behaviors = [];
21
22
        $model = $this->modelClass;
23
        //$model = new $model;
24
25
        if ($model->hasAttribute($model->removedAttribute)) {
0 ignored issues
show
Bug introduced by
The method hasAttribute cannot be called on $model (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
26
            $behaviors[] = TrashQueryBehavior::className();
27
        }
28
29
        if($model->hasAttribute('lft')&&$model->hasAttribute('rgt')&&$model->hasAttribute('depth')){
0 ignored issues
show
Bug introduced by
The method hasAttribute cannot be called on $model (of type string).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
30
            $behaviors[] = NestedSetsQueryBehavior::className();
31
        }
32
33
        return $behaviors;
34
    }
35
}
36