@@ -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; |
@@ -23,8 +23,8 @@ discard block |
||
| 23 | 23 | public static function today() |
| 24 | 24 | { |
| 25 | 25 | return [ |
| 26 | - mktime(0, 0, 0, (int) date('m'), (int) date('d'), (int) date('Y')), |
|
| 27 | - mktime(23, 59, 59, (int) date('m'), (int) date('d'), (int) date('Y')), |
|
| 26 | + mktime(0, 0, 0, (int)date('m'), (int)date('d'), (int)date('Y')), |
|
| 27 | + mktime(23, 59, 59, (int)date('m'), (int)date('d'), (int)date('Y')), |
|
| 28 | 28 | ]; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -35,10 +35,10 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | public static function yesterday() |
| 37 | 37 | { |
| 38 | - $yesterday = (int) date('d') - 1; |
|
| 38 | + $yesterday = (int)date('d') - 1; |
|
| 39 | 39 | return [ |
| 40 | - mktime(0, 0, 0, (int) date('m'), $yesterday, (int) date('Y')), |
|
| 41 | - mktime(23, 59, 59, (int) date('m'), $yesterday, (int) date('Y')), |
|
| 40 | + mktime(0, 0, 0, (int)date('m'), $yesterday, (int)date('Y')), |
|
| 41 | + mktime(23, 59, 59, (int)date('m'), $yesterday, (int)date('Y')), |
|
| 42 | 42 | ]; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public static function tomorrow() |
| 51 | 51 | { |
| 52 | - $tomorrow = (int) date('d') + 1; |
|
| 52 | + $tomorrow = (int)date('d') + 1; |
|
| 53 | 53 | return [ |
| 54 | - mktime(0, 0, 0, (int) date('m'), $tomorrow, (int) date('Y')), |
|
| 55 | - mktime(23, 59, 59, (int) date('m'), $tomorrow, (int) date('Y')), |
|
| 54 | + mktime(0, 0, 0, (int)date('m'), $tomorrow, (int)date('Y')), |
|
| 55 | + mktime(23, 59, 59, (int)date('m'), $tomorrow, (int)date('Y')), |
|
| 56 | 56 | ]; |
| 57 | 57 | } |
| 58 | 58 | |
@@ -106,8 +106,8 @@ discard block |
||
| 106 | 106 | public static function month() |
| 107 | 107 | { |
| 108 | 108 | return [ |
| 109 | - mktime(0, 0, 0, (int) date('m'), 1, (int) date('Y')), |
|
| 110 | - mktime(23, 59, 59, (int) date('m'), (int) date('t'), (int) date('Y')), |
|
| 109 | + mktime(0, 0, 0, (int)date('m'), 1, (int)date('Y')), |
|
| 110 | + mktime(23, 59, 59, (int)date('m'), (int)date('t'), (int)date('Y')), |
|
| 111 | 111 | ]; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | */ |
| 119 | 119 | public static function lastMonth() |
| 120 | 120 | { |
| 121 | - $begin = mktime(0, 0, 0, (int) date('m') - 1, 1, (int) date('Y')); |
|
| 122 | - $end = mktime(23, 59, 59, (int) date('m') - 1, (int) date('t', $begin), (int) date('Y')); |
|
| 121 | + $begin = mktime(0, 0, 0, (int)date('m') - 1, 1, (int)date('Y')); |
|
| 122 | + $end = mktime(23, 59, 59, (int)date('m') - 1, (int)date('t', $begin), (int)date('Y')); |
|
| 123 | 123 | |
| 124 | 124 | return [$begin, $end]; |
| 125 | 125 | } |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | public static function nextMonth() |
| 133 | 133 | { |
| 134 | - $begin = mktime(0, 0, 0, (int) date('m') + 1, 1, (int) date('Y')); |
|
| 135 | - $end = mktime(23, 59, 59, (int) date('m') + 1, (int) date('t', $begin), (int) date('Y')); |
|
| 134 | + $begin = mktime(0, 0, 0, (int)date('m') + 1, 1, (int)date('Y')); |
|
| 135 | + $end = mktime(23, 59, 59, (int)date('m') + 1, (int)date('t', $begin), (int)date('Y')); |
|
| 136 | 136 | |
| 137 | 137 | return [$begin, $end]; |
| 138 | 138 | } |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | public static function year() |
| 146 | 146 | { |
| 147 | 147 | return [ |
| 148 | - mktime(0, 0, 0, 1, 1, (int) date('Y')), |
|
| 149 | - mktime(23, 59, 59, 12, 31, (int) date('Y')), |
|
| 148 | + mktime(0, 0, 0, 1, 1, (int)date('Y')), |
|
| 149 | + mktime(23, 59, 59, 12, 31, (int)date('Y')), |
|
| 150 | 150 | ]; |
| 151 | 151 | } |
| 152 | 152 | |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | */ |
| 158 | 158 | public static function lastYear() |
| 159 | 159 | { |
| 160 | - $year = (int) date('Y') - 1; |
|
| 160 | + $year = (int)date('Y') - 1; |
|
| 161 | 161 | return [ |
| 162 | 162 | mktime(0, 0, 0, 1, 1, $year), |
| 163 | 163 | mktime(23, 59, 59, 12, 31, $year), |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | */ |
| 172 | 172 | public static function nextYear() |
| 173 | 173 | { |
| 174 | - $year = (int) date('Y') + 1; |
|
| 174 | + $year = (int)date('Y') + 1; |
|
| 175 | 175 | return [ |
| 176 | 176 | mktime(0, 0, 0, 1, 1, $year), |
| 177 | 177 | mktime(23, 59, 59, 12, 31, $year), |
@@ -486,6 +486,6 @@ |
||
| 486 | 486 | if (null === $this->_pemPublic) { |
| 487 | 487 | throw new Exception("请使用 setPair 提供公钥"); |
| 488 | 488 | } |
| 489 | - return (boolean) openssl_verify($data, $signature, $this->_pemPublic, $signType); |
|
| 489 | + return (boolean)openssl_verify($data, $signature, $this->_pemPublic, $signType); |
|
| 490 | 490 | } |
| 491 | 491 | } |