Passed
Push — nested-sections ( 2d40b2...7dbf34 )
by Arnaud
12:03 queued 05:37
created

Css::setProcessor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Cecil.
7
 *
8
 * Copyright (c) Arnaud Ligny <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace Cecil\Step\Optimize;
15
16
use MatthiasMullie\Minify;
17
18
/**
19
 * Optimize CSS files.
20
 */
21
class Css extends AbstractOptimize
22
{
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function getName(): string
27
    {
28
        return 'Optimizing CSS';
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function init(array $options): void
35
    {
36
        $this->type = 'css';
37
        parent::init($options);
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function setProcessor(): void
44
    {
45
    }
46
47
    /**
48
     * {@inheritdoc}
49
     */
50
    public function processFile(\Symfony\Component\Finder\SplFileInfo $file): string
51
    {
52
        $minifier = new Minify\CSS($file->getPathname());
53
54
        return $minifier->minify();
55
    }
56
}
57