| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | public function behaviors() |
||
| 19 | { |
||
| 20 | $behaviors = []; |
||
| 21 | |||
| 22 | $model = $this->modelClass; |
||
| 23 | //$model = new $model; |
||
| 24 | |||
| 25 | if ($model->hasAttribute($model->removedAttribute)) { |
||
|
|
|||
| 26 | $behaviors[] = TrashQueryBehavior::className(); |
||
| 27 | } |
||
| 28 | |||
| 29 | if($model->hasAttribute('lft')&&$model->hasAttribute('rgt')&&$model->hasAttribute('depth')){ |
||
| 30 | $behaviors[] = NestedSetsQueryBehavior::className(); |
||
| 31 | } |
||
| 32 | |||
| 33 | return $behaviors; |
||
| 34 | } |
||
| 35 | } |
||
| 36 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.