Passed
Pull Request — master (#61)
by Dmitriy
02:49
created

DevPanelAsset::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 9
ccs 0
cts 5
cp 0
rs 10
cc 2
nc 2
nop 2
crap 6
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Viewer\Asset;
6
7
use Yiisoft\Assets\AssetBundle;
8
use Yiisoft\View\WebView;
9
10
final class DevPanelAsset extends AssetBundle
11
{
12
    public bool $cdn = true;
13
    public array $js = [];
14
    public array $css = [];
15
16
    public function __construct(string $staticUrl, bool $registerServiceWorker)
17
    {
18
        $this->js[] = [$staticUrl . '/bundle.js', WebView::POSITION_END, 'type' => 'module'];
19
20
        if ($registerServiceWorker) {
21
            $this->js[] = $staticUrl . '/registerSW.js';
22
        }
23
24
        $this->css[] = $staticUrl . '/bundle.css';
25
    }
26
}
27