@@ -189,7 +189,7 @@ |
||
189 | 189 | */ |
190 | 190 | public static function create() |
191 | 191 | { |
192 | - if (!static::$_instance instanceof static ) { |
|
192 | + if (!static::$_instance instanceof static) { |
|
193 | 193 | static::$_instance = new static(); |
194 | 194 | } |
195 | 195 | return static::$_instance; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | public function __construct($image) |
28 | 28 | { |
29 | 29 | $attributes = $this->__parseImage($image); |
30 | - array_map(function ($value, $key) { |
|
30 | + array_map(function($value, $key) { |
|
31 | 31 | $this->_attributes[$key] = $value; |
32 | 32 | }, array_values($attributes), array_keys($attributes)); |
33 | 33 | $this->_imageIn = $this->_attributes['object']; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $zoomWidth *= $this->_attributes['width']; |
151 | 151 | $zoomHeight *= $this->_attributes['height']; |
152 | 152 | } else { |
153 | - $zoom = (int) $zoom; |
|
153 | + $zoom = (int)$zoom; |
|
154 | 154 | $zoomWidth = $zoom * $this->_attributes['width']; |
155 | 155 | $zoomHeight = $zoom * $this->_attributes['height']; |
156 | 156 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public static function create($config = []) |
241 | 241 | { |
242 | - if (!static::$_instance instanceof static ) { |
|
242 | + if (!static::$_instance instanceof static) { |
|
243 | 243 | static::$_instance = new static(); |
244 | 244 | if (!empty($config['dsn'])) { |
245 | 245 | $dbName = 'test'; |
@@ -550,7 +550,7 @@ discard block |
||
550 | 550 | if (empty($where)) { |
551 | 551 | return ''; |
552 | 552 | } |
553 | - $generator = function ($key, $value) use (&$generator) { |
|
553 | + $generator = function($key, $value) use (&$generator) { |
|
554 | 554 | // 索引列 |
555 | 555 | if (is_numeric($key)) { |
556 | 556 | if (is_array($value) && !empty($value)) { |
@@ -597,11 +597,11 @@ discard block |
||
597 | 597 | * ] |
598 | 598 | * ==>> id IN (1,2,3) |
599 | 599 | */ |
600 | - array_map(function ($data, $i) { |
|
600 | + array_map(function($data, $i) { |
|
601 | 601 | $this->__params[':i' . ($this->__i + $i)] = $data; |
602 | 602 | }, $value[2], array_keys($value[2])); |
603 | 603 | |
604 | - $condition = '(' . $value[1] . ' ' . strtoupper($value[0]) . ' (' . implode(',', array_map(function ($i) { |
|
604 | + $condition = '(' . $value[1] . ' ' . strtoupper($value[0]) . ' (' . implode(',', array_map(function($i) { |
|
605 | 605 | return ':i' . ($this->__i + $i); |
606 | 606 | }, array_keys($value[2]))) . '))'; |
607 | 607 | $this->__i += count($value[2]); |
@@ -624,10 +624,10 @@ discard block |
||
624 | 624 | } else { |
625 | 625 | // 关联列 |
626 | 626 | if (is_array($value)) { |
627 | - $condition = '(' . $key . ' IN (' . implode(',', array_map(function ($i) { |
|
627 | + $condition = '(' . $key . ' IN (' . implode(',', array_map(function($i) { |
|
628 | 628 | return ':i' . ($this->__i + $i); |
629 | 629 | }, array_keys($value))) . '))'; |
630 | - array_map(function ($data, $i) { |
|
630 | + array_map(function($data, $i) { |
|
631 | 631 | $this->__params[':i' . ($this->__i + $i)] = $data; |
632 | 632 | }, $value, array_keys($value)); |
633 | 633 | $this->__i += count($value); |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | */ |
692 | 692 | public function orderBy($orderBys) |
693 | 693 | { |
694 | - $this->__orderBy = array_map(function ($sort, $field) { |
|
694 | + $this->__orderBy = array_map(function($sort, $field) { |
|
695 | 695 | return $field . ' ' . $sort; |
696 | 696 | }, array_values($orderBys), array_keys($orderBys)); |
697 | 697 | |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | public function rawSql() |
856 | 856 | { |
857 | 857 | $this->__parse(); |
858 | - $rawSql = str_replace(array_keys($this->__params), array_map(function ($data) { |
|
858 | + $rawSql = str_replace(array_keys($this->__params), array_map(function($data) { |
|
859 | 859 | return 'string' == gettype($data) ? '\'' . $data . '\'' : $data; |
860 | 860 | }, array_values($this->__params)), $this->__queryString); |
861 | 861 | $this->__reset(); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | */ |
51 | 51 | public static function create($config = []) |
52 | 52 | { |
53 | - if (!static::$_instance instanceof static ) { |
|
53 | + if (!static::$_instance instanceof static) { |
|
54 | 54 | static::$_instance = new static(); |
55 | 55 | static::$_instance->__formName = I::get($config, 'formName', 'file'); |
56 | 56 | static::$_instance->__sizeLimit = static::$_instance->__getSizeLimit(I::get($config, 'sizeLimit', 0)); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | */ |
58 | 58 | public function getCurrentClassMethods($callback = null) |
59 | 59 | { |
60 | - $callback = null === $callback ? function () { |
|
60 | + $callback = null === $callback ? function() { |
|
61 | 61 | return true; |
62 | 62 | } : $callback; |
63 | 63 | $currentClass = $this->__reflector->getName(); |
@@ -57,7 +57,7 @@ |
||
57 | 57 | public static function stripTags($html, $allowTags = []) |
58 | 58 | { |
59 | 59 | $allowTags = array_map('strtolower', $allowTags); |
60 | - return preg_replace_callback('/<\/?([^>\s]+)[^>]*>/i', function ($matches) use (&$allowTags) { |
|
60 | + return preg_replace_callback('/<\/?([^>\s]+)[^>]*>/i', function($matches) use (&$allowTags) { |
|
61 | 61 | return in_array(strtolower($matches[1]), $allowTags) ? $matches[0] : ''; |
62 | 62 | }, $html); |
63 | 63 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | { |
51 | 51 | $delta = 0.0; |
52 | 52 | if (isset(static::$_timers[$name])) { |
53 | - $delta = microtime(true)-static::$_timers[$name]; |
|
53 | + $delta = microtime(true) - static::$_timers[$name]; |
|
54 | 54 | unset(static::$_timers[$name]); |
55 | 55 | } |
56 | 56 |
@@ -78,8 +78,8 @@ |
||
78 | 78 | } |
79 | 79 | return $mixed; |
80 | 80 | } elseif (is_string($mixed) || is_numeric($mixed)) { |
81 | - $pos = (int) $keyString; |
|
82 | - $length = null === $defaultValue ? 1 : (int) $defaultValue; |
|
81 | + $pos = (int)$keyString; |
|
82 | + $length = null === $defaultValue ? 1 : (int)$defaultValue; |
|
83 | 83 | return Strings::sub($mixed, $pos, $length); |
84 | 84 | } elseif (null === $mixed) { |
85 | 85 | return $defaultValue; |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | if ($number % 2 == 1) { |
389 | 389 | $number += 1; |
390 | 390 | } |
391 | - return (int) $number; |
|
391 | + return (int)$number; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $arr = []; |
641 | 641 | for ($r = 0; $r < $row1; $r++) { |
642 | 642 | for ($c = 0; $c < $col2; $c++) { |
643 | - $arr[$r][$c] = array_sum(array_map(function ($a1, $a2) { |
|
643 | + $arr[$r][$c] = array_sum(array_map(function($a1, $a2) { |
|
644 | 644 | return $a1 * $a2; |
645 | 645 | }, $array1[$r], Arrays::column($array2, $c))); |
646 | 646 | } |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | public static function multinomial($number1) |
690 | 690 | { |
691 | 691 | $numbers = is_array($number1) ? $number1 : func_get_args(); |
692 | - return self::fact(array_sum($numbers)) / array_product(array_map(function ($num) { |
|
692 | + return self::fact(array_sum($numbers)) / array_product(array_map(function($num) { |
|
693 | 693 | return self::fact($num); |
694 | 694 | }, $numbers)); |
695 | 695 | } |
@@ -732,7 +732,7 @@ discard block |
||
732 | 732 | if ($number % 2 == 0) { |
733 | 733 | $number += 1; |
734 | 734 | } |
735 | - return (int) $number; |
|
735 | + return (int)$number; |
|
736 | 736 | } |
737 | 737 | |
738 | 738 | /** |
@@ -781,7 +781,7 @@ discard block |
||
781 | 781 | */ |
782 | 782 | public static function quotient($numberator, $denominator) |
783 | 783 | { |
784 | - return (int) ($numberator / $denominator); |
|
784 | + return (int)($numberator / $denominator); |
|
785 | 785 | } |
786 | 786 | |
787 | 787 | /** |
@@ -819,11 +819,11 @@ discard block |
||
819 | 819 | */ |
820 | 820 | public static function randarray($row = 1, $col = 1, $min = 0, $max = null, $isInt = false) |
821 | 821 | { |
822 | - null === $max && $max = (int) pow(10, 10); |
|
822 | + null === $max && $max = (int)pow(10, 10); |
|
823 | 823 | $array = []; |
824 | 824 | for ($i = 0; $i < $row; $i++) { |
825 | 825 | for ($j = 0; $j < $col; $j++) { |
826 | - $array[$i][$j] = mt_rand($min, $max) + ($isInt ? 0 : mt_rand(0, (int) pow(10, 10)) / pow(10, 10)); |
|
826 | + $array[$i][$j] = mt_rand($min, $max) + ($isInt ? 0 : mt_rand(0, (int)pow(10, 10)) / pow(10, 10)); |
|
827 | 827 | } |
828 | 828 | } |
829 | 829 | return $array; |
@@ -989,7 +989,7 @@ discard block |
||
989 | 989 | $k = 1; |
990 | 990 | for ($i = 0; $i < $row; $i++) { |
991 | 991 | for ($j = 0; $j < $col; $j++) { |
992 | - $array[$i][$j] = $start + ($k++ - 1) * $step; |
|
992 | + $array[$i][$j] = $start + ($k++ -1) * $step; |
|
993 | 993 | } |
994 | 994 | } |
995 | 995 | return $array; |
@@ -1126,7 +1126,7 @@ discard block |
||
1126 | 1126 | array_push($arr[$i], $array[$i]); |
1127 | 1127 | } |
1128 | 1128 | } |
1129 | - return array_sum(array_map(function ($rows) { |
|
1129 | + return array_sum(array_map(function($rows) { |
|
1130 | 1130 | return array_product($rows); |
1131 | 1131 | }, $arr)); |
1132 | 1132 | } |
@@ -1141,7 +1141,7 @@ discard block |
||
1141 | 1141 | public static function sumsq($number1) |
1142 | 1142 | { |
1143 | 1143 | $numbers = is_array($number1) ? $number1 : func_get_args(); |
1144 | - return array_sum(array_map(function ($num) { |
|
1144 | + return array_sum(array_map(function($num) { |
|
1145 | 1145 | return $num * $num; |
1146 | 1146 | }, $numbers)); |
1147 | 1147 | } |