Issues (213)

src/widgets/combo/ServerStateRefCombo.php (1 issue)

1
<?php
2
3
namespace hipanel\modules\server\widgets\combo;
4
5
use hipanel\widgets\RefCombo;
6
use Yii;
7
8
class ServerStateRefCombo extends RefCombo
9
{
10
    public function prepareData()
11
    {
12
        $refs = parent::prepareData();
13
        if (Yii::$app->user->can('ref.view.not-used')) {
0 ignored issues
show
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

13
        if (Yii::$app->user->/** @scrutinizer ignore-call */ can('ref.view.not-used')) {

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...
14
            return $refs;
15
        }
16
17
        return array_filter($refs, function ($k) {
18
            return in_array($k, ['setuping', 'error', 'ok']);
19
        }, ARRAY_FILTER_USE_KEY);
20
    }
21
}
22