@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | */ |
| 80 | 80 | public static function toBytes($size) |
| 81 | 81 | { |
| 82 | - $callback = function ($matches) { |
|
| 82 | + $callback = function($matches) { |
|
| 83 | 83 | $sizeMap = [ |
| 84 | 84 | '' => 0, |
| 85 | 85 | 'b' => 0, // 为了简化正则 |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | return $matches[1] * pow(1024, $sizeMap[strtolower($matches[2])]); |
| 94 | 94 | }; |
| 95 | 95 | |
| 96 | - return (int) preg_replace_callback('/(\d*)\s*([a-z]?)b?/i', $callback, $size, 1); |
|
| 96 | + return (int)preg_replace_callback('/(\d*)\s*([a-z]?)b?/i', $callback, $size, 1); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | if ($toBaseInput == '0123456789') { |
| 157 | 157 | $retval = 0; |
| 158 | 158 | for ($i = 1; $i <= $numberLen; $i++) { |
| 159 | - $retval = bcadd($retval, bcmul((string) array_search($number[$i - 1], $fromBase), bcpow($fromLen, $numberLen - $i))); |
|
| 159 | + $retval = bcadd($retval, bcmul((string)array_search($number[$i - 1], $fromBase), bcpow($fromLen, $numberLen - $i))); |
|
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | return $retval; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $zoomWidth *= $this->_attributes['width']; |
| 152 | 152 | $zoomHeight *= $this->_attributes['height']; |
| 153 | 153 | } else { |
| 154 | - $zoom = (int) $zoom; |
|
| 154 | + $zoom = (int)$zoom; |
|
| 155 | 155 | $zoomWidth = $zoom * $this->_attributes['width']; |
| 156 | 156 | $zoomHeight = $zoom * $this->_attributes['height']; |
| 157 | 157 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * |
| 298 | 298 | * @return \icy2003\php\ihelpers\Color Color 类对象 |
| 299 | 299 | */ |
| 300 | - public function getColor($x, $y){ |
|
| 300 | + public function getColor($x, $y) { |
|
| 301 | 301 | $rgb = imagecolorat($this->_attributes['object'], $x, $y); |
| 302 | 302 | return new Color([($rgb >> 16) & 0xFF, ($rgb >> 8) & 0xFF, $rgb & 0xFF], Color::TYPE_RGB); |
| 303 | 303 | } |