Completed
Push — master ( 453053...27aa7f )
by Klochok
11:58
created

ServiceActionsMenu   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 21
ccs 0
cts 8
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A items() 0 16 1
1
<?php
2
3
namespace hipanel\modules\hosting\menus;
4
5
use hiqdev\menumanager\Menu;
6
use Yii;
7
8
class ServiceActionsMenu 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' => ['@service/view', 'id' => $this->model->id],
19
            ],
20
            [
21
                'label' => Yii::t('hipanel', 'Update'),
22
                'icon' => 'fa-pencil',
23
                'url' => ['@service/update', 'id' => $this->model->id],
24
                'visible' => Yii::$app->user->can('admin'),
25
            ],
26
        ];
27
    }
28
}
29