@@ -83,6 +83,6 @@ |
||
83 | 83 | public static function toFile($string, $file = null) |
84 | 84 | { |
85 | 85 | null === $file && $file = './Base64_toFile_' . date('YmdHis') . '.txt'; |
86 | - return (bool) file_put_contents($file, base64_decode($string)); |
|
86 | + return (bool)file_put_contents($file, base64_decode($string)); |
|
87 | 87 | } |
88 | 88 | } |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | $promise = $client->requestAsync('GET', $url, [ |
54 | 54 | 'query' => $get, |
55 | 55 | ]); |
56 | - $promise->then(function (ResponseInterface $res) use ($success) { |
|
56 | + $promise->then(function(ResponseInterface $res) use ($success) { |
|
57 | 57 | $success && $success($res->getBody()->getContents(), $res); |
58 | - }, function (RequestException $err) use ($error) { |
|
58 | + }, function(RequestException $err) use ($error) { |
|
59 | 59 | $error && $error($err); |
60 | 60 | }); |
61 | 61 | } |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | 'query' => $get, |
100 | 100 | 'form_params' => $post, |
101 | 101 | ]); |
102 | - $promise->then(function (ResponseInterface $res) use ($success) { |
|
102 | + $promise->then(function(ResponseInterface $res) use ($success) { |
|
103 | 103 | $success && $success($res->getBody()->getContents(), $res); |
104 | - }, function (RequestException $err) use ($error) { |
|
104 | + }, function(RequestException $err) use ($error) { |
|
105 | 105 | $error && $error($err); |
106 | 106 | }); |
107 | 107 | } |
@@ -145,9 +145,9 @@ discard block |
||
145 | 145 | 'query' => $get, |
146 | 146 | 'body' => $body, |
147 | 147 | ]); |
148 | - $promise->then(function (ResponseInterface $res) use ($success) { |
|
148 | + $promise->then(function(ResponseInterface $res) use ($success) { |
|
149 | 149 | $success && $success($res->getBody()->getContents(), $res); |
150 | - }, function (RequestException $err) use ($error) { |
|
150 | + }, function(RequestException $err) use ($error) { |
|
151 | 151 | $error && $error($err); |
152 | 152 | }); |
153 | 153 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public static function ul($array) |
141 | 141 | { |
142 | - return implode(PHP_EOL, array_map(function ($row) { |
|
142 | + return implode(PHP_EOL, array_map(function($row) { |
|
143 | 143 | return '- ' . self::__text($row); |
144 | 144 | }, $array)); |
145 | 145 | } |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public static function ol($array) |
157 | 157 | { |
158 | - return implode(PHP_EOL, array_map(function ($row) { |
|
158 | + return implode(PHP_EOL, array_map(function($row) { |
|
159 | 159 | static $i = 1; |
160 | 160 | return ($i++) . '. ' . self::__text($row); |
161 | 161 | }, $array)); |
@@ -210,8 +210,8 @@ discard block |
||
210 | 210 | $title = array_shift($array); |
211 | 211 | $rows = $array; |
212 | 212 | } |
213 | - $lineFunc = function ($arr) { |
|
214 | - return '|' . implode('|', array_map(function ($line) { |
|
213 | + $lineFunc = function($arr) { |
|
214 | + return '|' . implode('|', array_map(function($line) { |
|
215 | 215 | return ' ' . self::__text($line) . ' '; |
216 | 216 | }, $arr)) . '|'; |
217 | 217 | }; |
@@ -116,7 +116,7 @@ |
||
116 | 116 | */ |
117 | 117 | public static function create() |
118 | 118 | { |
119 | - if (!static::$_instance instanceof static ) { |
|
119 | + if (!static::$_instance instanceof static) { |
|
120 | 120 | static::$_instance = new static(); |
121 | 121 | } |
122 | 122 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $sizeMap = [ |
51 | 51 | '' => 0, |
52 | 52 | 'b' => 0, // 为了简化正则 |
53 | - 'k' => 1, |
|
53 | + 'k' => 1, |
|
54 | 54 | 'm' => 2, |
55 | 55 | 'g' => 3, |
56 | 56 | 't' => 4, |
@@ -46,7 +46,7 @@ |
||
46 | 46 | */ |
47 | 47 | public static function size($sizeValue) |
48 | 48 | { |
49 | - $callback = function ($matches) { |
|
49 | + $callback = function($matches) { |
|
50 | 50 | $sizeMap = [ |
51 | 51 | '' => 0, |
52 | 52 | 'b' => 0, // 为了简化正则 |
@@ -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 | } |
@@ -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 | } |