@@ -201,7 +201,7 @@ |
||
| 201 | 201 | @ftp_chmod($this->_conn, $mode, $subFile); |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 | - return (boolean) @ftp_chmod($this->_conn, $mode, $file); |
|
| 204 | + return (boolean)@ftp_chmod($this->_conn, $mode, $file); |
|
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | /** |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | public function __construct($pathRoot = null) |
| 58 | 58 | { |
| 59 | 59 | if (null === $pathRoot) { |
| 60 | - $this->_pathRoot = (string) I::getAlias('@icy2003/php_runtime/cache'); |
|
| 60 | + $this->_pathRoot = (string)I::getAlias('@icy2003/php_runtime/cache'); |
|
| 61 | 61 | } else { |
| 62 | 62 | $this->_pathRoot = $pathRoot; |
| 63 | 63 | } |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | public static function combine($keys, $values) |
| 155 | 155 | { |
| 156 | 156 | if (count($keys) == count($values)) { |
| 157 | - return (array) array_combine($keys, $values); |
|
| 157 | + return (array)array_combine($keys, $values); |
|
| 158 | 158 | } |
| 159 | 159 | $array = []; |
| 160 | 160 | foreach ($keys as $index => $key) { |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | } else { |
| 472 | 472 | $function = $callback; |
| 473 | 473 | if (false === is_callable($callback)) { |
| 474 | - $function = function ($row) use ($callback, $isStrict) { |
|
| 474 | + $function = function($row) use ($callback, $isStrict) { |
|
| 475 | 475 | return true === $isStrict ? $row === $callback : $row == $callback; |
| 476 | 476 | }; |
| 477 | 477 | } |
@@ -76,7 +76,7 @@ |
||
| 76 | 76 | */ |
| 77 | 77 | public static function toBytes($size) |
| 78 | 78 | { |
| 79 | - $callback = function ($matches) { |
|
| 79 | + $callback = function($matches) { |
|
| 80 | 80 | $sizeMap = [ |
| 81 | 81 | '' => 0, |
| 82 | 82 | 'b' => 0, // 为了简化正则 |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | ]), [ |
| 56 | 56 | 'access_token' => $this->_token, |
| 57 | 57 | ])); |
| 58 | - $this->_toArrayCall = function ($result) { |
|
| 58 | + $this->_toArrayCall = function($result) { |
|
| 59 | 59 | return I::get($result, 'image'); |
| 60 | 60 | }; |
| 61 | 61 | |
@@ -84,8 +84,8 @@ |
||
| 84 | 84 | } |
| 85 | 85 | return $mixed; |
| 86 | 86 | } elseif (is_string($mixed) || is_numeric($mixed)) { // 字符串或数字 |
| 87 | - $pos = (int) $keyString; |
|
| 88 | - $length = null === $defaultValue ? 1 : (int) $defaultValue; |
|
| 87 | + $pos = (int)$keyString; |
|
| 88 | + $length = null === $defaultValue ? 1 : (int)$defaultValue; |
|
| 89 | 89 | return Strings::sub($mixed, $pos, $length); |
| 90 | 90 | } elseif (null === $mixed) { // null |
| 91 | 91 | return $defaultValue; |
@@ -480,6 +480,6 @@ |
||
| 480 | 480 | public function isVerify($data, $signature, $signType = OPENSSL_ALGO_SHA256) |
| 481 | 481 | { |
| 482 | 482 | C::assertNotTrue(null === $this->_pemPublic, '请使用 setPair 提供公钥'); |
| 483 | - return (boolean) openssl_verify($data, $signature, $this->_pemPublic, $signType); |
|
| 483 | + return (boolean)openssl_verify($data, $signature, $this->_pemPublic, $signType); |
|
| 484 | 484 | } |
| 485 | 485 | } |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | if (false === self::isJson($json)) { |
| 92 | 92 | $json = '[]'; |
| 93 | 93 | } |
| 94 | - echo $json;die; |
|
| 94 | + echo $json; die; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | /** |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | // 接收十六进制(如:0xFF0000和'FF0000')和颜色名字 |
| 309 | 309 | $hex = I::get(self::$_names, $color, $color); |
| 310 | 310 | if ($hex) { |
| 311 | - C::assertNotTrue($hex > 0xFFFFFF || $hex < 0 || hexdec($hex) === 0 && $hex !== '000000' && $hex !== '#000000' , '错误的颜色值:' . $color); |
|
| 311 | + C::assertNotTrue($hex > 0xFFFFFF || $hex < 0 || hexdec($hex) === 0 && $hex !== '000000' && $hex !== '#000000', '错误的颜色值:' . $color); |
|
| 312 | 312 | } |
| 313 | 313 | // 如果是字符形式的十六进制数,则先转成十进制再作后续运算 |
| 314 | 314 | if (is_string($hex)) { |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | { |
| 334 | 334 | $type = $this->_type; |
| 335 | 335 | if (self::TYPE_RGB === $type) { |
| 336 | - $this->_color = array_map(function ($i) { |
|
| 336 | + $this->_color = array_map(function($i) { |
|
| 337 | 337 | return (0.5 + $i) | 0; |
| 338 | 338 | }, $this->_color); |
| 339 | 339 | } elseif (self::TYPE_HEX === $type) { |
@@ -386,7 +386,7 @@ discard block |
||
| 386 | 386 | { |
| 387 | 387 | $type = $this->_type; |
| 388 | 388 | if (self::TYPE_CMYK === $type) { |
| 389 | - $this->_color = array_map(function ($i) { |
|
| 389 | + $this->_color = array_map(function($i) { |
|
| 390 | 390 | return sprintf('%01.4f', $i); |
| 391 | 391 | }, $this->_color); |
| 392 | 392 | $this->_type = self::TYPE_CMYK; |