1 | <?php |
---|
2 | |
---|
3 | /* |
---|
4 | * This file is part of the Assetic package, an OpenSky project. |
---|
5 | * |
---|
6 | * (c) 2010-2012 OpenSky Project Inc |
---|
7 | * |
---|
8 | * For the full copyright and license information, please view the LICENSE |
---|
9 | * file that was distributed with this source code. |
---|
10 | */ |
---|
11 | |
---|
12 | namespace Assetic\Filter\GoogleClosure; |
---|
13 | |
---|
14 | use Assetic\Asset\AssetInterface; |
---|
15 | use Assetic\Filter\FilterInterface; |
---|
16 | |
---|
17 | /** |
---|
18 | * Base filter for the Google Closure Compiler implementations. |
---|
19 | * |
---|
20 | * @author Kris Wallsmith <kris.wallsmith@gmail.com> |
---|
21 | */ |
---|
22 | abstract class BaseCompilerFilter implements FilterInterface |
---|
23 | { |
---|
24 | // compilation levels |
---|
25 | const COMPILE_WHITESPACE_ONLY = 'WHITESPACE_ONLY'; |
---|
26 | const COMPILE_SIMPLE_OPTIMIZATIONS = 'SIMPLE_OPTIMIZATIONS'; |
---|
27 | const COMPILE_ADVANCED_OPTIMIZATIONS = 'ADVANCED_OPTIMIZATIONS'; |
---|
28 | |
---|
29 | // formatting modes |
---|
30 | const FORMAT_PRETTY_PRINT = 'pretty_print'; |
---|
31 | const FORMAT_PRINT_INPUT_DELIMITER = 'print_input_delimiter'; |
---|
32 | |
---|
33 | // warning levels |
---|
34 | const LEVEL_QUIET = 'QUIET'; |
---|
35 | const LEVEL_DEFAULT = 'DEFAULT'; |
---|
36 | const LEVEL_VERBOSE = 'VERBOSE'; |
---|
37 | |
---|
38 | // languages |
---|
39 | const LANGUAGE_ECMASCRIPT3 = 'ECMASCRIPT3'; |
---|
40 | const LANGUAGE_ECMASCRIPT5 = 'ECMASCRIPT5'; |
---|
41 | const LANGUAGE_ECMASCRIPT5_STRICT = 'ECMASCRIPT5_STRICT'; |
---|
42 | |
---|
43 | protected $compilationLevel; |
---|
44 | protected $jsExterns; |
---|
45 | protected $externsUrl; |
---|
46 | protected $excludeDefaultExterns; |
---|
47 | protected $formatting; |
---|
48 | protected $useClosureLibrary; |
---|
49 | protected $warningLevel; |
---|
50 | protected $language; |
---|
51 | |
---|
52 | public function setCompilationLevel($compilationLevel) |
---|
53 | { |
---|
54 | $this->compilationLevel = $compilationLevel; |
---|
55 | } |
---|
56 | |
---|
57 | public function setJsExterns($jsExterns) |
---|
58 | { |
---|
59 | $this->jsExterns = $jsExterns; |
---|
60 | } |
---|
61 | |
---|
62 | public function setExternsUrl($externsUrl) |
---|
63 | { |
---|
64 | $this->externsUrl = $externsUrl; |
---|
65 | } |
---|
66 | |
---|
67 | public function setExcludeDefaultExterns($excludeDefaultExterns) |
---|
68 | { |
---|
69 | $this->excludeDefaultExterns = $excludeDefaultExterns; |
---|
70 | } |
---|
71 | |
---|
72 | public function setFormatting($formatting) |
---|
73 | { |
---|
74 | $this->formatting = $formatting; |
---|
75 | } |
---|
76 | |
---|
77 | public function setUseClosureLibrary($useClosureLibrary) |
---|
78 | { |
---|
79 | $this->useClosureLibrary = $useClosureLibrary; |
---|
80 | } |
---|
81 | |
---|
82 | public function setWarningLevel($warningLevel) |
---|
83 | { |
---|
84 | $this->warningLevel = $warningLevel; |
---|
85 | } |
---|
86 | |
---|
87 | public function setLanguage($language) |
---|
88 | { |
---|
89 | $this->language = $language; |
---|
90 | } |
---|
91 | |
---|
92 | public function filterLoad(AssetInterface $asset) |
---|
93 | { |
---|
94 | } |
---|
95 | } |
---|