BootstrapAsset   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 24
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 2
1
<?php
2
3
namespace App\Assets;
4
5
use Micro\Base\KernelInjector;
6
use Micro\Mvc\Views\IView;
7
use Micro\Web\Asset;
8
9
/**
10
 * Class BootstrapAsset
11
 * @package App\Assets
12
 */
13
class BootstrapAsset extends Asset
14
{
15
    public static $name = 'Bootstrap';
16
    public static $version = '3.3.6';
17
18
    /**
19
     * @param IView $view
20
     * @throws \Micro\Base\Exception
21
     */
22
    public function __construct(IView $view)
23
    {
24
        if ((new KernelInjector())->build()->isDebug()) {
25
            $this->js[] = '/js/bootstrap.js';
26
            $this->css[] = '/css/bootstrap.css';
27
        } else {
28
            $this->js[] = '/js/bootstrap.min.js';
29
            $this->css[] = '/css/bootstrap.min.css';
30
        }
31
32
        $this->sourcePath = (new KernelInjector)->build()->getAppDir() . '/../vendor/twbs/bootstrap/dist';
33
34
        parent::__construct($view);
35
    }
36
}
37