Passed
Pull Request — master (#25)
by Wilmer
02:21
created

BootstrapAsset   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 28
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Bootstrap5\Assets;
6
7
use Yiisoft\Assets\AssetBundle;
8
use Yiisoft\Files\PathMatcher\PathMatcher;
9
10
/**
11
 * Asset bundle for the Twitter bootstrap css files.
12
 *
13
 * BootstrapAsset.
14
 *
15
 * @package Bootstrap5
16
 */
17
final class BootstrapAsset extends AssetBundle
18
{
19
    public ?string $basePath = '@assets';
20
21
    public ?string $baseUrl = '@assetsUrl';
22
23
    public ?string $sourcePath = '@npm/bootstrap/dist';
24
25
    public array $css = [
26
        'css/bootstrap.css',
27
    ];
28
29
    public array $js = [
30
        'js/bootstrap.bundle.js',
31
    ];
32
33
    public array $publishOptions = [];
34
35 1
    public function __construct()
36
    {
37 1
        $pathMatcher = new PathMatcher();
38
39 1
        $this->publishOptions = [
40 1
            'filter' => $pathMatcher->only(
41 1
                'css/bootstrap.css',
42 1
                'css/bootstrap.css.map',
43 1
                'js/bootstrap.bundle.js',
44 1
                'js/bootstrap.bundle.js.map',
45
            ),
46
        ];
47 1
    }
48
}
49