@@ -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 | } |
@@ -134,8 +134,7 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | if ('true' == $requestColumn['orderable']) { |
| 136 | 136 | $dir = 'asc' === $request['order'][$i]['dir'] ? |
| 137 | - 'ASC' : |
|
| 138 | - 'DESC'; |
|
| 137 | + 'ASC' : 'DESC'; |
|
| 139 | 138 | |
| 140 | 139 | $orderBy[] = '`' . $column['db'] . '` ' . $dir; |
| 141 | 140 | } |
@@ -218,8 +217,7 @@ discard block |
||
| 218 | 217 | |
| 219 | 218 | if (count($columnSearch)) { |
| 220 | 219 | $where = '' === $where ? |
| 221 | - implode(' AND ', $columnSearch) : |
|
| 222 | - $where . ' AND ' . implode(' AND ', $columnSearch); |
|
| 220 | + implode(' AND ', $columnSearch) : $where . ' AND ' . implode(' AND ', $columnSearch); |
|
| 223 | 221 | } |
| 224 | 222 | |
| 225 | 223 | if ('' !== $where) { |
@@ -288,8 +286,7 @@ discard block |
||
| 288 | 286 | */ |
| 289 | 287 | return [ |
| 290 | 288 | 'draw' => isset($request['draw']) ? |
| 291 | - intval($request['draw']) : |
|
| 292 | - 0, |
|
| 289 | + intval($request['draw']) : 0, |
|
| 293 | 290 | 'recordsTotal' => intval($recordsTotal), |
| 294 | 291 | 'recordsFiltered' => intval($recordsFiltered), |
| 295 | 292 | 'data' => self::data_output($columns, $data), |
@@ -338,14 +335,12 @@ discard block |
||
| 338 | 335 | |
| 339 | 336 | if ($whereResult) { |
| 340 | 337 | $where = $where ? |
| 341 | - $where . ' AND ' . $whereResult : |
|
| 342 | - 'WHERE ' . $whereResult; |
|
| 338 | + $where . ' AND ' . $whereResult : 'WHERE ' . $whereResult; |
|
| 343 | 339 | } |
| 344 | 340 | |
| 345 | 341 | if ($whereAll) { |
| 346 | 342 | $where = $where ? |
| 347 | - $where . ' AND ' . $whereAll : |
|
| 348 | - 'WHERE ' . $whereAll; |
|
| 343 | + $where . ' AND ' . $whereAll : 'WHERE ' . $whereAll; |
|
| 349 | 344 | |
| 350 | 345 | $whereAllSql = 'WHERE ' . $whereAll; |
| 351 | 346 | } |
@@ -386,8 +381,7 @@ discard block |
||
| 386 | 381 | */ |
| 387 | 382 | return [ |
| 388 | 383 | 'draw' => isset($request['draw']) ? |
| 389 | - intval($request['draw']) : |
|
| 390 | - 0, |
|
| 384 | + intval($request['draw']) : 0, |
|
| 391 | 385 | 'recordsTotal' => intval($recordsTotal), |
| 392 | 386 | 'recordsFiltered' => intval($recordsFiltered), |
| 393 | 387 | 'data' => self::data_output($columns, $data), |