Completed
Push — master ( 7f45a1...6afdf1 )
by Andrey
01:18
created

AdminAsset   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 2
dl 0
loc 67
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 11 4
1
<?php
2
3
namespace Itstructure\AdminModule\assets;
4
5
use yii\base\Exception;
6
use yii\web\{AssetBundle, JqueryAsset, YiiAsset};
7
use yii\bootstrap\{BootstrapAsset, BootstrapPluginAsset};
8
9
/**
10
 * Main application asset bundle.
11
 *
12
 * @package Itstructure\AdminModule\assets
13
 */
14
class AdminAsset extends AssetBundle
15
{
16
    /**
17
     * @var string
18
     */
19
    public $sourcePath = '@vendor/almasaeed2010/adminlte';
20
21
    /**
22
     * @var string
23
     */
24
    public $skin = '_all-skins';
25
26
    /**
27
     * @var array
28
     */
29
    public $css = [
30
        'bower_components/bootstrap/dist/css/bootstrap.min.css',
31
        'bower_components/font-awesome/css/font-awesome.min.css',
32
        'bower_components/Ionicons/css/ionicons.min.css',
33
        'bower_components/jvectormap/jquery-jvectormap.css',
34
        'dist/css/AdminLTE.min.css',
35
    ];
36
37
    /**
38
     * @var array
39
     */
40
    public $js = [
41
        'bower_components/fastclick/lib/fastclick.js',
42
        'dist/js/adminlte.min.js',
43
        'bower_components/jquery-sparkline/dist/jquery.sparkline.min.js',
44
        'plugins/jvectormap/jquery-jvectormap-1.2.2.min.js',
45
        'plugins/jvectormap/jquery-jvectormap-world-mill-en.js',
46
        'bower_components/Chart.js/Chart.js',
47
48
        //'bower_components/bootstrap/dist/js/bootstrap.min.js', // If this is loaded, you may
49
        // experience a problem displaying the admin menu.
50
    ];
51
52
    /**
53
     * @var array
54
     */
55
    public $jsOptions = [
56
        'position' => \yii\web\View::POS_HEAD
57
    ];
58
59
    /**
60
     * @var array
61
     */
62
    public $depends = [
63
        BootstrapAsset::class,
64
        JqueryAsset::class,
65
        BootstrapPluginAsset::class,
66
        YiiAsset::class
67
    ];
68
69
    public function init()
70
    {
71
        if ($this->skin) {
72
            if (('_all-skins' !== $this->skin) && (strpos($this->skin, 'skin-') !== 0)) {
73
                throw new Exception('Invalid skin specified');
74
            }
75
            $this->css[] = sprintf('dist/css/skins/%s.min.css', $this->skin);
76
        }
77
78
        parent::init();
79
    }
80
}
81