VideosAsset   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 17 2
1
<?php
2
/**
3
 * @link      https://dukt.net/videos/
4
 * @copyright Copyright (c) Dukt
5
 * @license   https://github.com/dukt/videos/blob/v2/LICENSE.md
6
 */
7
8
namespace dukt\videos\web\assets\videos;
9
10
use craft\web\AssetBundle;
11
use craft\web\assets\cp\CpAsset;
12
use craft\web\assets\vue\VueAsset;
13
use dukt\videos\Plugin;
14
15
class VideosAsset extends AssetBundle
16
{
17
    // Public Methods
18
    // =========================================================================
19
20
    /**
21
     * @inheritdoc
22
     */
23
    public function init(): void
24
    {
25
        $this->depends = [
26
            CpAsset::class,
27
            VueAsset::class,
28
        ];
29
30
        if (!Plugin::getInstance()->getVideos()->useDevServer) {
31
            $this->sourcePath = __DIR__ . '/dist';
32
            $this->js[] = 'main.js';
33
            $this->css[] = 'css/main.css';
34
        } else {
35
            $this->css[] = 'https://localhost:8090/css/main.css';
36
            $this->js[] = 'https://localhost:8090/main.js';
37
        }
38
39
        parent::init();
40
    }
41
}