1 | <?php |
||
12 | class Processor |
||
13 | { |
||
14 | const FORMATTER_COMPRESSED = 'compressed'; |
||
15 | const FORMATTER_CRUNCHED = 'crunched'; |
||
16 | const FORMATTER_EXPANDED = 'expanded'; |
||
17 | const FORMATTER_NESTED = 'nested'; |
||
18 | const FORMATTER_COMPACT = 'compact'; |
||
19 | const SUPPORTED_FORMATTERS = [ |
||
20 | self::FORMATTER_COMPRESSED, |
||
21 | self::FORMATTER_CRUNCHED, |
||
22 | self::FORMATTER_EXPANDED, |
||
23 | self::FORMATTER_NESTED, |
||
24 | self::FORMATTER_COMPACT |
||
25 | ]; |
||
26 | /** |
||
27 | * @var IOInterface |
||
28 | */ |
||
29 | private $io; |
||
30 | /** |
||
31 | * @var File[] |
||
32 | */ |
||
33 | private $files = []; |
||
34 | /** |
||
35 | * @var SASSCompiler |
||
36 | */ |
||
37 | private $sass; |
||
38 | /** |
||
39 | * @var LESSCompiler |
||
40 | */ |
||
41 | private $less; |
||
42 | /** |
||
43 | * @var CompassCompiler |
||
44 | */ |
||
45 | private $compass; |
||
46 | |||
47 | public function __construct(IOInterface $io) |
||
52 | |||
53 | protected function initCompilers() |
||
60 | |||
61 | /** |
||
62 | * @param string $inputPath |
||
63 | * @param string $outputPath |
||
64 | * |
||
65 | * @throws \Exception |
||
66 | */ |
||
67 | public function attachFiles($inputPath, $outputPath) |
||
82 | |||
83 | /** |
||
84 | * @return string[] |
||
85 | */ |
||
86 | public function concatOutput() |
||
99 | |||
100 | /** |
||
101 | * save output into file |
||
102 | */ |
||
103 | public function saveOutput() |
||
117 | |||
118 | /** |
||
119 | * @param string $formatter |
||
120 | * |
||
121 | * @throws CompilerException |
||
122 | */ |
||
123 | public function processFiles($formatter) |
||
146 | |||
147 | /** |
||
148 | * @param string $formatter |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | protected function getFormatterClass($formatter) |
||
160 | } |
||
161 |