Completed
Push — optimize ( 1cb82b...432add )
by Arnaud
02:20 queued 14s
created

OptimizeCss::process()   B

Complexity

Conditions 6
Paths 11

Size

Total Lines 64

Duplication

Lines 64
Ratio 100 %

Importance

Changes 0
Metric Value
dl 64
loc 64
rs 8.1632
c 0
b 0
f 0
cc 6
nc 11
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/*
3
 * Copyright (c) Arnaud Ligny <[email protected]>
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Cecil\Step;
10
11
use MatthiasMullie\Minify;
12
13
/**
14
 * CSS files Optimization.
15
 */
16 View Code Duplication
class OptimizeCss extends AbstractStepOptimize
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
{
18
    public function setProcessor()
19
    {
20
        $this->type = 'css';
21
    }
22
23
    public function processFile(\Symfony\Component\Finder\SplFileInfo $file)
24
    {
25
        $minifier = new Minify\CSS($file->getPathname());
26
        $minified = $minifier->minify();
27
        \Cecil\Util::getFS()->dumpFile($file->getPathname(), $minified);
28
    }
29
}
30