Completed
Push — master ( ac44f9...7d4d5b )
by Klochok
05:18
created

IpActionsMenu::items()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 33
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 33
ccs 0
cts 19
cp 0
rs 8.8571
cc 1
eloc 15
nc 1
nop 0
crap 2
1
<?php
2
3
namespace hipanel\modules\hosting\menus;
4
5
use hiqdev\menumanager\Menu;
6
use Yii;
7
8
class IpActionsMenu extends Menu
9
{
10
    public $model;
11
12
    public function items()
13
    {
14
        return [
15
            'view' => [
16
                'label' => Yii::t('hipanel', 'View'),
17
                'icon' => 'fa-info',
18
                'url' => ['@ip/view', 'id' => $this->model->id],
19
            ],
20
            'expand' => [
21
                'label' => Yii::t('hipanel:hosting', 'Expand'),
22
                'icon' => 'fa-th',
23
                'url' => ['@ip/expand', 'id' => $this->model->id],
24
            ],
25
            'update' => [
26
                'label' => Yii::t('hipanel', 'Update'),
27
                'icon' => 'fa-pencil',
28
                'url' => ['@ip/update', 'id' => $this->model->id],
29
                'visible' => Yii::$app->user->can('admin'),
30
            ],
31
//            'delete' => [
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
32
//                'label' => Yii::t('hipanel', 'Delete'),
33
//                'icon' => 'fa-trash',
34
//                'url' => ['@ip/delete', 'id' => $this->model->id],
35
//                'linkOptions' => [
36
//                    'data' => [
37
//                        'confirm' => Yii::t('hipanel', 'Are you sure you want to delete this item?'),
38
//                        'method' => 'POST',
39
//                        'pjax' => '0',
40
//                    ],
41
//                ],
42
//            ],
43
        ];
44
    }
45
}
46