DocumentByMonthButton   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 1
dl 0
loc 36
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 17 1
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\widgets;
12
13
class DocumentByMonthButton extends \yii\base\Widget
14
{
15
    public $model;
16
17
    public $action;
18
19
    public $type;
20
21
    public $prepend;
22
23
    public $append;
24
25
    public $modalHeader;
26
27
    public $modalHeaderColor = '';
28
29
    public $buttonLabel;
30
31
    public function run()
32
    {
33
        $dt = new \DateTime();
34
        $this->model->month = $dt->format('Y-m'); // Set default value
35
36
        return $this->render('DocumentByMonthButton', [
37
            'model' => $this->model,
38
            'action' => $this->action,
39
            'type' => $this->type,
40
            'append' => $this->append,
41
            'prepend' => $this->prepend,
42
            'modalHeader' => $this->modalHeader,
43
            'modalHeaderColor' => $this->modalHeaderColor,
44
            'buttonLabel' => $this->buttonLabel,
45
            'dt' => $dt,
46
        ]);
47
    }
48
}
49