Completed
Push — master ( 678f4c...d13b92 )
by Andrii
10:30
created

HubQuery::withBindings()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\models\query;
12
13
use hiqdev\hiart\ActiveQuery;
14
use Yii;
15
16
class HubQuery extends ActiveQuery
17
{
18
    public function withBindings(): self
19
    {
20
        if (Yii::$app->user->can('hub.read')) {
0 ignored issues
show
Bug introduced by
The method can() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

20
        if (Yii::$app->user->/** @scrutinizer ignore-call */ can('hub.read')) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
21
            $this->joinWith('bindings');
22
            $this->andWhere(['with_bindings' => true]);
23
        }
24
25
        return $this;
26
    }
27
}
28