Completed
Push — master ( d123db...236d99 )
by Dmitry
09:19
created

SidebarMenu::items()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 27
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 4
Bugs 1 Features 2
Metric Value
c 4
b 1
f 2
dl 0
loc 27
ccs 0
cts 23
cp 0
rs 8.8571
cc 1
eloc 15
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * HiPanel tickets module
5
 *
6
 * @link      https://github.com/hiqdev/hipanel-module-ticket
7
 * @package   hipanel-module-ticket
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hipanel\modules\ticket;
13
14
use Yii;
15
16
class SidebarMenu extends \hipanel\base\Menu implements \yii\base\BootstrapInterface
17
{
18
    protected $_addTo = 'sidebar';
19
20
    protected $_where = [
21
        'after' => ['finance', 'clients', 'dashboard', 'header'],
22
        'before' => ['domains', 'servers', 'hosting'],
23
    ];
24
25
    public function items()
26
    {
27
        return [
28
            'tickets' => [
29
                'label' => Yii::t('hipanel/ticket', 'Tickets'),
30
                'url' => ['/ticket/ticket/index'],
31
                'icon' => 'fa-ticket',
32
                'items' => [
33
                    'tickets' => [
34
                        'label' => Yii::t('hipanel/ticket', 'Tickets'),
35
                        'url' => ['/ticket/ticket/index'],
36
                    ],
37
                    'templates' => [
38
                        'label' => Yii::t('hipanel/ticket', 'Templates'),
39
                        'url' => ['/ticket/template/index'],
40
                        'visible' => function () {
41
                            return Yii::$app->user->can('support');
42
                        },
43
                    ],
44
//                  'statistics' => [
0 ignored issues
show
Unused Code Comprehensibility introduced by
56% 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...
45
//                      'label' => Yii::t('hipanel/ticket', 'Tickets statistics'),
46
//                      'url'   => ['/ticket/ticket/statistics'],
47
//                  ],
48
                ],
49
            ],
50
        ];
51
    }
52
}
53