@@ -149,11 +149,11 @@ |
||
| 149 | 149 | */ |
| 150 | 150 | private function getPowerSum($iArr) { |
| 151 | 151 | $iSum = 0; |
| 152 | - $powerLen = count ( $this->power ); |
|
| 153 | - $arrLen = count ( $iArr ); |
|
| 152 | + $powerLen = count($this->power); |
|
| 153 | + $arrLen = count($iArr); |
|
| 154 | 154 | if ($powerLen == $arrLen) { |
| 155 | - for($i = 0; $i < $arrLen; $i ++) { |
|
| 156 | - for($j = 0; $j < $powerLen; $j ++) { |
|
| 155 | + for ($i = 0; $i < $arrLen; $i++) { |
|
| 156 | + for ($j = 0; $j < $powerLen; $j++) { |
|
| 157 | 157 | if ($i == $j) { |
| 158 | 158 | $iSum = $iSum + $iArr [$i] * $this->power [$j]; |
| 159 | 159 | } |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | 'url' => ['value', 'url'], |
| 31 | 31 | 'object' => [ |
| 32 | 32 | 'value', |
| 33 | - function ($attribute) { |
|
| 33 | + function($attribute) { |
|
| 34 | 34 | $object = null; |
| 35 | 35 | try { |
| 36 | 36 | Json::decode($this->$attribute); |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | */ |
| 97 | 97 | protected function setValues($data, $duration) |
| 98 | 98 | { |
| 99 | - return $this->yac->set($data,$duration); |
|
| 99 | + return $this->yac->set($data, $duration); |
|
| 100 | 100 | } |
| 101 | 101 | /** |
| 102 | 102 | * Stores a value identified by a key into cache if the cache does not contain this key. |
@@ -968,7 +968,7 @@ |
||
| 968 | 968 | { |
| 969 | 969 | // Does this string have any 4+ byte Unicode chars? |
| 970 | 970 | if (max(array_map('ord', str_split($string))) >= 240) { |
| 971 | - $string = preg_replace_callback('/./u', function (array $match) { |
|
| 971 | + $string = preg_replace_callback('/./u', function(array $match) { |
|
| 972 | 972 | if (strlen($match[0]) >= 4) { |
| 973 | 973 | // (Logic pulled from WP's wp_encode_emoji() function) |
| 974 | 974 | // UTF-32's hex encoding is the same as HTML's hex encoding. |
@@ -214,7 +214,9 @@ discard block |
||
| 214 | 214 | $i = 0; |
| 215 | 215 | } else { |
| 216 | 216 | for ($i = 1; $i < 12; $i++) { |
| 217 | - if ((100 * $month + $day) >= $zone [$i] && (100 * $month + $day) < $zone [$i + 1]) break; |
|
| 217 | + if ((100 * $month + $day) >= $zone [$i] && (100 * $month + $day) < $zone [$i + 1]) { |
|
| 218 | + break; |
|
| 219 | + } |
|
| 218 | 220 | } |
| 219 | 221 | } |
| 220 | 222 | $result = $data [$i] . '座'; |
@@ -314,7 +316,9 @@ discard block |
||
| 314 | 316 | { |
| 315 | 317 | $year = $year ? $year : date('Y'); |
| 316 | 318 | $months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; |
| 317 | - if (self::isLeapYear($year)) $months [1] = 29; |
|
| 319 | + if (self::isLeapYear($year)) { |
|
| 320 | + $months [1] = 29; |
|
| 321 | + } |
|
| 318 | 322 | return $months; |
| 319 | 323 | } |
| 320 | 324 | |
@@ -89,18 +89,18 @@ |
||
| 89 | 89 | { |
| 90 | 90 | $config = []; |
| 91 | 91 | foreach ([ |
| 92 | - 'host', |
|
| 93 | - 'port', |
|
| 94 | - 'username', |
|
| 95 | - 'password', |
|
| 96 | - 'ssl', |
|
| 97 | - 'timeout', |
|
| 98 | - 'root', |
|
| 99 | - 'permPrivate', |
|
| 100 | - 'permPublic', |
|
| 101 | - 'passive', |
|
| 102 | - 'transferMode', |
|
| 103 | - ] as $name) { |
|
| 92 | + 'host', |
|
| 93 | + 'port', |
|
| 94 | + 'username', |
|
| 95 | + 'password', |
|
| 96 | + 'ssl', |
|
| 97 | + 'timeout', |
|
| 98 | + 'root', |
|
| 99 | + 'permPrivate', |
|
| 100 | + 'permPublic', |
|
| 101 | + 'passive', |
|
| 102 | + 'transferMode', |
|
| 103 | + ] as $name) { |
|
| 104 | 104 | if ($this->$name !== null) { |
| 105 | 105 | $config[$name] = $this->$name; |
| 106 | 106 | } |
@@ -90,16 +90,16 @@ |
||
| 90 | 90 | $config = []; |
| 91 | 91 | |
| 92 | 92 | foreach ([ |
| 93 | - 'host', |
|
| 94 | - 'port', |
|
| 95 | - 'username', |
|
| 96 | - 'password', |
|
| 97 | - 'timeout', |
|
| 98 | - 'root', |
|
| 99 | - 'privateKey', |
|
| 100 | - 'permPrivate', |
|
| 101 | - 'permPublic', |
|
| 102 | - ] as $name) { |
|
| 93 | + 'host', |
|
| 94 | + 'port', |
|
| 95 | + 'username', |
|
| 96 | + 'password', |
|
| 97 | + 'timeout', |
|
| 98 | + 'root', |
|
| 99 | + 'privateKey', |
|
| 100 | + 'permPrivate', |
|
| 101 | + 'permPublic', |
|
| 102 | + ] as $name) { |
|
| 103 | 103 | if ($this->$name !== null) { |
| 104 | 104 | $config[$name] = $this->$name; |
| 105 | 105 | } |
@@ -63,13 +63,13 @@ |
||
| 63 | 63 | $config = []; |
| 64 | 64 | |
| 65 | 65 | foreach ([ |
| 66 | - 'baseUri', |
|
| 67 | - 'userName', |
|
| 68 | - 'password', |
|
| 69 | - 'proxy', |
|
| 70 | - 'authType', |
|
| 71 | - 'encoding', |
|
| 72 | - ] as $name) { |
|
| 66 | + 'baseUri', |
|
| 67 | + 'userName', |
|
| 68 | + 'password', |
|
| 69 | + 'proxy', |
|
| 70 | + 'authType', |
|
| 71 | + 'encoding', |
|
| 72 | + ] as $name) { |
|
| 73 | 73 | if ($this->$name !== null) { |
| 74 | 74 | $config[$name] = $this->$name; |
| 75 | 75 | } |
@@ -75,6 +75,6 @@ |
||
| 75 | 75 | ]; |
| 76 | 76 | $cosApi = new Api($config); |
| 77 | 77 | |
| 78 | - return new \Freyo\Flysystem\QcloudCOSv4\Adapter($cosApi,$config); |
|
| 78 | + return new \Freyo\Flysystem\QcloudCOSv4\Adapter($cosApi, $config); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | \ No newline at end of file |