@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -67,8 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | private function lookForPreMinifiedAsset() |
69 | 69 | { |
70 | - $min_path = (string)Str::s($this->file->getRealPath())->replace |
|
71 | - ( |
|
70 | + $min_path = (string)Str::s($this->file->getRealPath())->replace( |
|
72 | 71 | '.'.$this->file->getExtension(), |
73 | 72 | '.min.'.$this->file->getExtension() |
74 | 73 | ); |
@@ -73,7 +73,10 @@ |
||
73 | 73 | '.min.'.$this->file->getExtension() |
74 | 74 | ); |
75 | 75 | |
76 | - if (!file_exists($min_path)) return false; |
|
76 | + if (!file_exists($min_path)) |
|
77 | + { |
|
78 | + return false; |
|
79 | + } |
|
77 | 80 | |
78 | 81 | return file_get_contents($min_path); |
79 | 82 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -76,8 +76,7 @@ discard block |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | // Create the real path to the actual asset |
79 | - $css_asset_path = realpath |
|
80 | - ( |
|
79 | + $css_asset_path = realpath( |
|
81 | 80 | $css_asset_root.'/'. |
82 | 81 | $fileinfo['dirname'].'/'. |
83 | 82 | $fileinfo['filename'].'.'. |
@@ -94,8 +93,7 @@ discard block |
||
94 | 93 | |
95 | 94 | // Now lets calulate the relative path between the destination |
96 | 95 | // location and the actual asset location. |
97 | - $css_asset_path = (new Filesystem())->makePathRelative |
|
98 | - ( |
|
96 | + $css_asset_path = (new Filesystem())->makePathRelative( |
|
99 | 97 | $css_asset_path, |
100 | 98 | $destination_root |
101 | 99 | ); |
@@ -111,8 +109,7 @@ discard block |
||
111 | 109 | $css_asset_path = Str::s($css_asset_path)->replace('\\', '/'); |
112 | 110 | |
113 | 111 | // Do some search and replacing |
114 | - $source = (string) Str::s($source)->replace |
|
115 | - ( |
|
112 | + $source = (string)Str::s($source)->replace( |
|
116 | 113 | 'url('.$match.')', |
117 | 114 | 'url('.$css_asset_path.$after_file_name.')' |
118 | 115 | ); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -116,8 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | if (!class_exists($minifier)) |
118 | 118 | { |
119 | - throw new RuntimeException |
|
120 | - ( |
|
119 | + throw new RuntimeException( |
|
121 | 120 | 'Minification is not supported for type: '. |
122 | 121 | $this->destination->getExtension() |
123 | 122 | ); |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -207,8 +207,7 @@ discard block |
||
207 | 207 | // Plus this should error out early if we can't write to the file |
208 | 208 | if (!$result) |
209 | 209 | { |
210 | - throw new RuntimeException |
|
211 | - ( |
|
210 | + throw new RuntimeException( |
|
212 | 211 | 'We can not write to the destination file: '. |
213 | 212 | $this->destination->getPathname() |
214 | 213 | ); |
@@ -259,15 +258,13 @@ discard block |
||
259 | 258 | // Does the compiler exist |
260 | 259 | if (!class_exists($compiler_type)) |
261 | 260 | { |
262 | - throw new RuntimeException |
|
263 | - ( |
|
261 | + throw new RuntimeException( |
|
264 | 262 | 'The source file type is not supported! - ('.$file.')' |
265 | 263 | ); |
266 | 264 | } |
267 | 265 | |
268 | 266 | // Return the compiler |
269 | - return new $compiler_type |
|
270 | - ( |
|
267 | + return new $compiler_type( |
|
271 | 268 | $file, |
272 | 269 | $this->destination, |
273 | 270 | $this->debug, |
@@ -361,8 +358,7 @@ discard block |
||
361 | 358 | // Write the normal asset |
362 | 359 | if (file_put_contents($this->destination->getPathname(), $asset_contents) === false) |
363 | 360 | { |
364 | - throw new RuntimeException |
|
365 | - ( |
|
361 | + throw new RuntimeException( |
|
366 | 362 | 'Failed to write asset: '.$this->destination->getPathname() |
367 | 363 | ); |
368 | 364 | } |
@@ -379,8 +375,7 @@ discard block |
||
379 | 375 | |
380 | 376 | if (file_put_contents($gz_file_name, $gz_contents) === false) |
381 | 377 | { |
382 | - throw new RuntimeException |
|
383 | - ( |
|
378 | + throw new RuntimeException( |
|
384 | 379 | 'Failed to write gzipped version of asset: '. |
385 | 380 | $gz_file_name |
386 | 381 | ); |
@@ -124,11 +124,20 @@ discard block |
||
124 | 124 | } |
125 | 125 | else |
126 | 126 | { |
127 | - if (!is_array($value)) $value = [$value]; |
|
127 | + if (!is_array($value)) |
|
128 | + { |
|
129 | + $value = [$value]; |
|
130 | + } |
|
128 | 131 | |
129 | - if (count($value) === 0) throw new \UnexpectedValueException; |
|
132 | + if (count($value) === 0) |
|
133 | + { |
|
134 | + throw new \UnexpectedValueException; |
|
135 | + } |
|
130 | 136 | |
131 | - if (!is_string($value[0])) throw new \UnexpectedValueException; |
|
137 | + if (!is_string($value[0])) |
|
138 | + { |
|
139 | + throw new \UnexpectedValueException; |
|
140 | + } |
|
132 | 141 | |
133 | 142 | $this->source = $value; |
134 | 143 | } |
@@ -286,7 +295,10 @@ discard block |
||
286 | 295 | */ |
287 | 296 | protected function getSourceType(SplFileInfo $file): string |
288 | 297 | { |
289 | - if ($file->isDir()) return 'folder'; |
|
298 | + if ($file->isDir()) |
|
299 | + { |
|
300 | + return 'folder'; |
|
301 | + } |
|
290 | 302 | return $file->getExtension(); |
291 | 303 | } |
292 | 304 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | //////////////////////////////////////////////////////////////////////////////// |
3 | 3 | // __________ __ ________ __________ |
4 | 4 | // \______ \ |__ ______ / _____/ ____ _____ ______\______ \ _______ ___ |