SweetAlert2Asset::init()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
crap 2
1
<?php
2
3
namespace dominus77\sweetalert2\assets;
4
5
use yii\web\AssetBundle;
6
7
/**
8
 * Class SweetAlert2Asset
9
 * @package dominus77\sweetalert2\assets
10
 */
11
class SweetAlert2Asset extends AssetBundle
12
{
13
    /**
14
     * @var string
15
     */
16
    public $sourcePath = '@npm/sweetalert2/dist';
17
18
    /**
19
     * @var array
20
     */
21
    public $js = [];
22
23
    /**
24
     * @inheritdoc
25
     */
26 5
    public function init()
27
    {
28 5
        $min = YII_ENV_DEV ? '' : '.min';
29 5
        $this->js[] = 'sweetalert2.all' . $min . '.js';
30 5
    }
31
}
32