SidebarMenu   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 30
ccs 0
cts 27
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A items() 0 27 1
1
<?php
2
/**
3
 * HiPanel tickets module
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-ticket
6
 * @package   hipanel-module-ticket
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\ticket\menus;
12
13
use Yii;
14
15
class SidebarMenu extends \hiqdev\yii2\menus\Menu
16
{
17
    public function items()
18
    {
19
        return [
20
            'tickets' => [
21
                'label' => Yii::t('hipanel:ticket', 'Support'),
22
                'url' => ['/ticket/ticket/index'],
23
                'icon' => 'fa-life-ring',
24
                'items' => [
25
                    'tickets' => [
26
                        'label' => Yii::t('hipanel:ticket', 'Tickets'),
27
                        'url' => ['/ticket/ticket/index'],
28
                        'visible' => Yii::$app->user->can('ticket.read'),
29
                    ],
30
                    'templates' => [
31
                        'label' => Yii::t('hipanel:ticket', 'Templates'),
32
                        'url' => ['/ticket/template/index'],
33
                        'visible' => Yii::$app->user->can('support'),
34
                    ],
35
                    'statistics' => [
36
                        'label' => Yii::t('hipanel:ticket', 'Tickets statistics'),
37
                        'url'   => ['/ticket/statistic/index'],
38
                        'visible' => Yii::$app->user->can('manage'),
39
                    ],
40
                ],
41
            ],
42
        ];
43
    }
44
}
45