Passed
Push — master ( 27bb26...4d04fd )
by Alexey
03:08
created

ChartJsAsset   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
eloc 10
c 1
b 0
f 1
dl 0
loc 25
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 9 2
1
<?php
2
3
namespace backend\widgets\chart\chartjs\assets;
4
5
use yii\web\AssetBundle;
6
use yii\web\JqueryAsset;
7
8
/**
9
 * Class ChartJsAsset
10
 *
11
 * @package backend\widgets\chart\chartjs\assets
12
 */
13
class ChartJsAsset extends AssetBundle
14
{
15
    /** @var string */
16
    public $sourcePath = '@bower/chart.js/dist';
17
18
    /**
19
     * @inheritDoc
20
     */
21
    public function init()
22
    {
23
        parent::init();
24
        $min = YII_ENV_DEV ? '' : '.min';
25
        $this->css = [
26
            'Chart' . $min . '.css'
27
        ];
28
        $this->js = [
29
            'Chart' . $min . '.js'
30
        ];
31
    }
32
33
    /**
34
     * @var string[]
35
     */
36
    public $depends = [
37
        JqueryAsset::class,
38
    ];
39
}
40