Completed
Push — master ( cf9d7b...8e5f78 )
by Andrii
24:46 queued 09:50
created

SaleActionsMenu   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 9
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Finance module for HiPanel
4
 *
5
 * @link      https://github.com/hiqdev/hipanel-module-finance
6
 * @package   hipanel-module-finance
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2015-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\modules\finance\menus;
12
13
use hipanel\modules\finance\models\Sale;
14
use hiqdev\yii2\menus\Menu;
15
use Yii;
16
17
class SaleActionsMenu extends Menu
18
{
19
    public Sale $model;
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
20
21
    public function items(): array
22
    {
23
        return [
24
            'update' => [
25
                'label' => Yii::t('hipanel:finance:sale', 'Edit'),
26
                'icon' => 'fa-pencil',
27
                'url' => ['@sale/update', 'id' => $this->model->id],
28
                'linkOptions' => [
29
                    'data-pjax' => 0,
30
                ],
31
                'visible' => Yii::$app->user->can('sale.update'),
32
            ],
33
        ];
34
    }
35
}
36