File tree Expand file tree Collapse file tree 4 files changed +39
-16
lines changed Expand file tree Collapse file tree 4 files changed +39
-16
lines changed Original file line number Diff line number Diff line change
1
+ checks :
2
+ php : true
3
+
4
+ coding_style :
5
+ php : { }
6
+
7
+ filter :
8
+ excluded_paths : ["bin/*", "tests/*", "vendor/*"]
9
+
10
+ build :
11
+ environment :
12
+ php :
13
+ version : " 7.0.4"
14
+ # tests:
15
+ # override:
16
+ # -
17
+ # command: "php bin/phpunit -c phpunit.xml --colors=always --verbose --coverage-clover=coverage.xml"
18
+ # coverage:
19
+ # file: "coverage.xml"
20
+ # format: "php-clover"
Original file line number Diff line number Diff line change
1
+ [ ![ Scrutinizer Code Quality] ( https://scrutinizer-ci.com/g/learn-symfony/css-compiler/badges/quality-score.png?b=master )] ( https://scrutinizer-ci.com/g/learn-symfony/css-compiler/?branch=master )
2
+
1
3
[ ![ Latest Stable Version] ( https://poser.pugx.org/eugene-matvejev/css-compiler/version )] ( https://packagist.org/packages/eugene-matvejev/css-compiler )
2
4
[ ![ Total Downloads] ( https://poser.pugx.org/eugene-matvejev/css-compiler/downloads )] ( https://packagist.org/packages/eugene-matvejev/css-compiler )
3
5
[ ![ License] ( https://poser.pugx.org/eugene-matvejev/css-compiler/license )] ( https://packagist.org/packages/eugene-matvejev/css-compiler )
Original file line number Diff line number Diff line change 23
23
"require" : {
24
24
"php" : " >= 5.5.9" ,
25
25
"leafo/lessphp" : " ^0.5" ,
26
- "leafo/scssphp-compass" : " dev-master"
26
+ "leafo/scssphp" : " @dev" ,
27
+ "leafo/scssphp-compass" : " @dev"
27
28
},
28
29
"require-dev" : {
29
30
"composer/composer" : " ^1.1" ,
Original file line number Diff line number Diff line change @@ -10,6 +10,16 @@ class File
10
10
const TYPE_SASS = 'sass ' ;
11
11
const TYPE_COMPASS = 'compass ' ;
12
12
const TYPE_LESS = 'less ' ;
13
+ const TYPE_UNKNOWN = 'unknown ' ;
14
+ /**
15
+ * @var string[]
16
+ */
17
+ private static $ extensions = [
18
+ self ::TYPE_SCSS ,
19
+ self ::TYPE_SASS ,
20
+ self ::TYPE_COMPASS ,
21
+ self ::TYPE_LESS ,
22
+ ];
13
23
/**
14
24
* @var string
15
25
*/
@@ -157,21 +167,11 @@ public function setType($type)
157
167
*/
158
168
private function detectSourceTypeFromPath ($ path )
159
169
{
160
- switch (true ) {
161
- case 0 !== preg_match ('/^.*\. ' . static ::TYPE_SCSS . '/ ' , $ path ):
162
- $ this ->type = static ::TYPE_SCSS ;
163
- break ;
164
- case 0 !== preg_match ('/^.*\. ' . static ::TYPE_SASS . '/ ' , $ path ):
165
- $ this ->type = static ::TYPE_SASS ;
166
- break ;
167
- case 0 !== preg_match ('/^.*\. ' . static ::TYPE_COMPASS . '/ ' , $ path ):
168
- $ this ->type = static ::TYPE_COMPASS ;
169
- break ;
170
- case 0 !== preg_match ('/^.*\. ' . static ::TYPE_LESS . '/ ' , $ path ):
171
- $ this ->type = static ::TYPE_LESS ;
172
- break ;
173
- default :
174
- $ this ->type = 'unknown ' ;
170
+ $ extension = strtolower (pathinfo ($ path , PATHINFO_EXTENSION ));
171
+ if (in_array ($ extension , static ::$ extensions )) {
172
+ $ this ->type = $ extension ;
173
+ } else {
174
+ $ this ->type = static ::TYPE_UNKNOWN ;
175
175
}
176
176
}
177
177
You can’t perform that action at this time.
0 commit comments