Issues (213)

src/grid/ServerRepresentations.php (1 issue)

1
<?php
2
/**
3
 * Server module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-server
6
 * @package   hipanel-module-server
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\server\grid;
12
13
use hiqdev\higrid\representations\RepresentationCollection;
14
use Yii;
15
16
class ServerRepresentations extends RepresentationCollection
17
{
18
    protected function fillRepresentations(): void
19
    {
20
        $this->representations = array_filter([
21
            'short' => Yii::$app->user->can('support') ? [
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

21
            'short' => Yii::$app->user->/** @scrutinizer ignore-call */ can('support') ? [

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...
22
                'label' => Yii::t('hipanel:server', 'short'),
23
                'columns' => [
24
                    'checkbox',
25
                    'ips', 'client', 'dc', 'actions', 'server', 'order_no', 'hwsummary',
26
                ],
27
            ] : null,
28
            'common' => [
29
                'label' => Yii::t('hipanel', 'common'),
30
                'columns' => [
31
                    'checkbox',
32
                    'actions',
33
                    'server', 'client_like', 'seller_id',
34
                    'ips', 'tariff_and_discount', 'hwsummary',
35
                ],
36
            ],
37
            'hardware' => Yii::$app->user->can('part.read') ? [
38
                'label' => Yii::t('hipanel:server', 'hardware'),
39
                'columns' => [
40
                    'checkbox',
41
                    'rack', 'client', 'dc', 'actions', 'server', 'hwsummary', 'hwcomment',
42
                ],
43
            ] : null,
44
            'manager' => Yii::$app->user->can('manage') ? [
45
                'label' => Yii::t('hipanel:server', 'manager'),
46
                'columns' => [
47
                    'checkbox',
48
                    'client_like',
49
                    'rack', 'actions', 'server', 'tariff',
50
                    'hwsummary', 'hwcomment', 'nums',
51
                ],
52
            ] : null,
53
            'billing' => Yii::$app->user->can('consumption.read') && Yii::$app->user->can('manage') ? [
54
                'label' => Yii::t('hipanel:server', 'billing'),
55
                'columns' => [
56
                    'checkbox',
57
                    'rack',
58
                    'actions',
59
                    'server',
60
                    'client_like',
61
                    'tariff',
62
                    'monthly_fee',
63
                    'traffic',
64
                    'additional_services',
65
                    'type_of_sale',
66
                    'hwsummary',
67
                ],
68
            ] : null,
69
            'admin' => Yii::$app->user->can('support') ? [
70
                'label' => Yii::t('hipanel:server', 'admin'),
71
                'columns' => [
72
                    'checkbox',
73
                    'dc', 'actions', 'server', 'type',
74
                    'net', 'kvm', 'ipmi', 'pdu', 'ip', 'mac', 'hwsummary',
75
                ],
76
            ] : null,
77
        ]);
78
    }
79
}
80