@@ -16,22 +16,22 @@ |
||
16 | 16 | return $input; |
17 | 17 | } |
18 | 18 | // Remove extra white-space(s) between HTML attribute(s) |
19 | - $input = preg_replace_callback('#<([^\/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(\/?)>#s', function ($matches) { |
|
19 | + $input = preg_replace_callback('#<([^\/\s<>!]+)(?:\s+([^<>]*?)\s*|\s*)(\/?)>#s', function($matches) { |
|
20 | 20 | return '<' . $matches[1] . preg_replace('#([^\s=]+)(\=([\'"]?)(.*?)\3)?(\s+|$)#s', ' $1$2', $matches[2]) . $matches[3] . '>'; |
21 | 21 | }, str_replace("\r", '', $input)); |
22 | 22 | // Minify inline CSS declaration(s) |
23 | 23 | if (false !== strpos($input, ' style=')) { |
24 | - $input = preg_replace_callback('#<([^<]+?)\s+style=([\'"])(.*?)\2(?=[\/\s>])#s', function ($matches) { |
|
24 | + $input = preg_replace_callback('#<([^<]+?)\s+style=([\'"])(.*?)\2(?=[\/\s>])#s', function($matches) { |
|
25 | 25 | return '<' . $matches[1] . ' style=' . $matches[2] . self::minify_css($matches[3]) . $matches[2]; |
26 | 26 | }, $input); |
27 | 27 | } |
28 | 28 | if (false !== strpos($input, '</style>')) { |
29 | - $input = preg_replace_callback('#<style(.*?)>(.*?)</style>#is', function ($matches) { |
|
29 | + $input = preg_replace_callback('#<style(.*?)>(.*?)</style>#is', function($matches) { |
|
30 | 30 | return '<style' . $matches[1] . '>' . self::minify_css($matches[2]) . '</style>'; |
31 | 31 | }, $input); |
32 | 32 | } |
33 | 33 | if (false !== strpos($input, '</script>')) { |
34 | - $input = preg_replace_callback('#<script(.*?)>(.*?)</script>#is', function ($matches) { |
|
34 | + $input = preg_replace_callback('#<script(.*?)>(.*?)</script>#is', function($matches) { |
|
35 | 35 | return '<script' . $matches[1] . '>' . self::minify_js($matches[2]) . '</script>'; |
36 | 36 | }, $input); |
37 | 37 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public static function js_array(array $array) |
13 | 13 | { |
14 | - $temp = array_map(function ($index) { |
|
14 | + $temp = array_map(function($index) { |
|
15 | 15 | return self::js_str($index); |
16 | 16 | }, $array); |
17 | 17 |
@@ -250,7 +250,7 @@ |
||
250 | 250 | |
251 | 251 | return "<?php\n" . $this->getPrettyPrinter()->prettyPrint($ast); |
252 | 252 | } catch (Exception $e) { |
253 | - if($ignoreError) { |
|
253 | + if ($ignoreError) { |
|
254 | 254 | sprintf('Could not parse file "%s"', $file); |
255 | 255 | $this->getEventDispatcher()->dispatch( |
256 | 256 | 'obfuscator.file.error', |
@@ -37,7 +37,7 @@ |
||
37 | 37 | { |
38 | 38 | if ($salt === null) { |
39 | 39 | $this->setSalt( |
40 | - md5(microtime(true) . rand(0,1)) |
|
40 | + md5(microtime(true) . rand(0, 1)) |
|
41 | 41 | ); |
42 | 42 | } else { |
43 | 43 | $this->setSalt($salt); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $this->finalizeContainer($input); |
107 | 107 | |
108 | 108 | // Change runtime memory |
109 | - if($memory = $input->getOption('memory_limit')) { |
|
109 | + if ($memory = $input->getOption('memory_limit')) { |
|
110 | 110 | ini_set("memory_limit", $memory); |
111 | 111 | } |
112 | 112 | // Input/output dirs |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | ); |
145 | 145 | // Show error processing file |
146 | - if($ignoreError) { |
|
146 | + if ($ignoreError) { |
|
147 | 147 | $this->getObfuscator()->getEventDispatcher()->addListener( |
148 | 148 | 'obfuscator.file.error', |
149 | 149 | function(FileErrorEvent $event) use ($output, $directory) { |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | exec($command, $output, $return); |
221 | 221 | |
222 | - if ($return !== 0) { |
|
222 | + if ($return !== 0) { |
|
223 | 223 | throw new \Exception('Could not copy directory'); |
224 | 224 | } |
225 | 225 |
@@ -100,7 +100,7 @@ |
||
100 | 100 | foreach ($nodes as $node) { |
101 | 101 | // Scramble the private method definitions |
102 | 102 | if ($node instanceof Property && ($node->type & ClassNode::MODIFIER_PRIVATE)) { |
103 | - foreach($node->props as $property) { |
|
103 | + foreach ($node->props as $property) { |
|
104 | 104 | |
105 | 105 | // Record original name and scramble it |
106 | 106 | $originalName = $property->name; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | |
97 | 97 | $implements = array(); |
98 | 98 | |
99 | - foreach($node->implements as $implementsName) { |
|
99 | + foreach ($node->implements as $implementsName) { |
|
100 | 100 | |
101 | 101 | // Old name (as string) |
102 | 102 | $oldName = $implementsName->toString(); |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | foreach ($nodes as $node) { |
176 | 176 | // Scramble the private method definitions |
177 | 177 | if ($node instanceof UseStatement) { |
178 | - foreach($node->uses as $useNode) { |
|
178 | + foreach ($node->uses as $useNode) { |
|
179 | 179 | |
180 | 180 | // Record original name and scramble it |
181 | 181 | $originalName = $useNode->name->toString(); |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | **/ |
228 | 228 | private function findClass(array $nodes) |
229 | 229 | { |
230 | - foreach($nodes as $node) { |
|
230 | + foreach ($nodes as $node) { |
|
231 | 231 | if ($node instanceof ClassStatement) { |
232 | 232 | return $node; |
233 | 233 | } |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | public function handle(int $timeout, string $folder = null) |
50 | 50 | { |
51 | - $name = '_' . $timeout . md5(\MVC\helper::getRequestIP() . \MVC\helper::useragent()); |
|
51 | + $name = '_' . $timeout . md5(\MVC\helper::getRequestIP() . \MVC\helper::useragent()); |
|
52 | 52 | if (empty(trim($folder)) || !$folder) { |
53 | 53 | $folder = \Filemanager\file::folder(__DIR__ . '/sessions'); |
54 | 54 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | * |
97 | 97 | * @return string domain or default |
98 | 98 | */ |
99 | - $savedname = function () { |
|
99 | + $savedname = function() { |
|
100 | 100 | global $url; |
101 | 101 | $savedname = \MVC\helper::url2host($url); |
102 | 102 | if (!$savedname) { |