Factory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 21
wmc 1
lcom 0
cbo 5
ccs 5
cts 5
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 9 1
1
<?php
2
/**
3
 * The base factory to build minifiers
4
 *
5
 * PHP version 5.5
6
 *
7
 * @category   Minifine
8
 * @author     Pieter Hordijk <[email protected]>
9
 * @copyright  Copyright (c) 2015 Pieter Hordijk <https://pieterhordijk.com>
10
 * @license    See the LICENSE file
11
 * @version    1.0.0
12
 */
13
namespace Minifine;
14
15
use Minifine\Minifier\Js\MatthiasMullie as MatthiasMullieJs;
16
use Minifine\Minifier\Css\MatthiasMullie as MatthiasMullieCss;
17
use MatthiasMullie\Minify\JS;
18
use MatthiasMullie\Minify\CSS;
19
20
/**
21
 * The base factory to build minifiers
22
 *
23
 * @category   Minifine
24
 * @author     Pieter Hordijk <[email protected]>
25
 */
26
class Factory implements Builder
27
{
28
    /**
29
     * Builds a new minifine instance
30
     *
31
     * @param string $basePath   The base path to the resources (under most common cases this will be the public web
32
     *                           root directory)
33
     * @param bool   $production The current environment
34
     *
35
     * @return \Minifine\Minifine
36
     */
37 2
    public function build($basePath, $production = false)
38
    {
39 2
        $minifine = new Minifine($basePath, $production);
40
41 2
        $minifine->appendJsMinifier(new MatthiasMullieJs(new JS()));
42 2
        $minifine->appendCssMinifier(new MatthiasMullieCss(new Css()));
43
44 2
        return $minifine;
45
    }
46
}
47