Passed
Push — master ( 0602c9...8f96ba )
by Thierry
02:02
created

Minifier::minify()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
/**
4
 * Minifier.php - JS and CSS minifier
5
 *
6
 * Minify the javascript code generated by the Jaxon library and plugins.
7
 *
8
 * @package jaxon-core
0 ignored issues
show
Coding Style introduced by
Package name "jaxon-core" is not valid; consider "Jaxoncore" instead
Loading history...
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2016 Thierry Feuzeu <[email protected]>
11
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
12
 * @link https://github.com/jaxon-php/jaxon-core
13
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
14
15
namespace Jaxon\Utils\File;
16
17
use MatthiasMullie\Minify\JS as JsMinifier;
18
19
class Minifier
0 ignored issues
show
Coding Style introduced by
Missing doc comment for class Minifier
Loading history...
20
{
21
    /**
22
     * Minify javascript code
23
     *
24
     * @param string        $sJsFile                The javascript file to be minified
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 2 spaces after parameter name; 16 found
Loading history...
25
     * @param string        $sMinFile               The minified javascript file
0 ignored issues
show
Coding Style introduced by
Expected 1 spaces after parameter type; 8 found
Loading history...
Coding Style introduced by
Expected 1 spaces after parameter name; 15 found
Loading history...
26
     *
27
     * @return boolean        True if the file was minified
28
     */
29
    public function minify($sJsFile, $sMinFile)
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
30
    {
31
        $xJsMinifier = new JsMinifier();
32
        $xJsMinifier->add($sJsFile);
33
        $xJsMinifier->minify($sMinFile);
34
        return is_file($sMinFile);
35
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
36
}
37