JqueryAsset   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 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 JqueryAsset
11
 * @package App\Assets
12
 */
13
class JqueryAsset extends Asset
14
{
15
    public static $name = 'JQuery';
16
    public static $version = '2.2.1';
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[] = '/jquery.js';
26
        } else {
27
            $this->js[] = '/jquery.min.js';
28
        }
29
30
        $this->sourcePath = (new KernelInjector)->build()->getAppDir() . '/../vendor/components/jquery';
31
32
        parent::__construct($view);
33
    }
34
}
35