@@ -26,7 +26,6 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * Convert a sex string to int type. |
| 28 | 28 | * |
| 29 | - * @param mixed $string |
|
| 30 | 29 | * @return int |
| 31 | 30 | */ |
| 32 | 31 | public static function type($sex) |
@@ -43,7 +42,7 @@ discard block |
||
| 43 | 42 | /** |
| 44 | 43 | * All sex types. |
| 45 | 44 | * |
| 46 | - * @return int[] |
|
| 45 | + * @return integer[] |
|
| 47 | 46 | */ |
| 48 | 47 | public static function allTypes() |
| 49 | 48 | { |
@@ -47,6 +47,6 @@ |
||
| 47 | 47 | */ |
| 48 | 48 | public static function allTypes() |
| 49 | 49 | { |
| 50 | - return [static::MALE, static::FEMALE]; |
|
| 50 | + return [ static::MALE, static::FEMALE ]; |
|
| 51 | 51 | } |
| 52 | 52 | } |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @var array |
| 13 | 13 | */ |
| 14 | - protected $only = []; |
|
| 14 | + protected $only = [ ]; |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Enable encryption for the given cookie name(s). |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function isDisabled($name) |
| 34 | 34 | { |
| 35 | - return ! in_array($name, $this->only); |
|
| 35 | + return !in_array($name, $this->only); |
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | protected function storeImageFile($file, $identifier = null) |
| 22 | 22 | { |
| 23 | - if ($file instanceof UploadedFile && ! $file->isValid()) { |
|
| 23 | + if ($file instanceof UploadedFile && !$file->isValid()) { |
|
| 24 | 24 | return; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -30,14 +30,14 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $filename = (string) $this->option('filename'); |
| 32 | 32 | |
| 33 | - $assets = $this->laravel['config']->get($filename); |
|
| 33 | + $assets = $this->laravel[ 'config' ]->get($filename); |
|
| 34 | 34 | |
| 35 | 35 | $revisioned = $this->revisionAssets($assets); |
| 36 | 36 | |
| 37 | 37 | if ($assets !== $revisioned) { |
| 38 | 38 | $this->updateAssetsVersionConfigFile($filename, $revisioned); |
| 39 | 39 | |
| 40 | - $this->laravel['config'][$filename] = $revisioned; |
|
| 40 | + $this->laravel[ 'config' ][ $filename ] = $revisioned; |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $this->info('Assets version configuration'. |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | protected function revisionAssets($assets) |
| 55 | 55 | { |
| 56 | - $newAssets = []; |
|
| 56 | + $newAssets = [ ]; |
|
| 57 | 57 | |
| 58 | 58 | if (is_array($assets)) { |
| 59 | 59 | foreach ($assets as $filename => $value) { |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $this->error("Revisioning file [{$filename}] failed."); |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - $newAssets[$filename] = $value; |
|
| 75 | + $newAssets[ $filename ] = $value; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
@@ -38,17 +38,17 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function handle() |
| 40 | 40 | { |
| 41 | - if (! $this->option('alone')) { |
|
| 41 | + if (!$this->option('alone')) { |
|
| 42 | 42 | $this->call('clear-compiled'); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if ($this->laravel->bound('command.ide-helper.generate')) { |
| 46 | 46 | $this->call('ide-helper:generate'); |
| 47 | 47 | $this->call('ide-helper:meta'); |
| 48 | - $this->call('ide-helper:models', ['-R' => true, '-N' => true]); |
|
| 48 | + $this->call('ide-helper:models', [ '-R' => true, '-N' => true ]); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (! $this->option('alone')) { |
|
| 51 | + if (!$this->option('alone')) { |
|
| 52 | 52 | $this->call('optimize'); |
| 53 | 53 | } |
| 54 | 54 | } |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | $this->setCharactersInEnvironmentFile($characters); |
| 39 | 39 | |
| 40 | - $this->laravel['config']['support.int2string'] = $characters; |
|
| 40 | + $this->laravel[ 'config' ][ 'support.int2string' ] = $characters; |
|
| 41 | 41 | |
| 42 | 42 | $this->info("Characters [<comment>$characters</comment>] set successfully."); |
| 43 | 43 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function handle() |
| 32 | 32 | { |
| 33 | - $values = array_combine(['prime', 'inverse', 'random'], Energon::generate()); |
|
| 33 | + $values = array_combine([ 'prime', 'inverse', 'random' ], Energon::generate()); |
|
| 34 | 34 | |
| 35 | 35 | if ($this->option('show')) { |
| 36 | 36 | return $this->printValues($values); |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | $this->setValuesInEnvironmentFile($values); |
| 40 | 40 | |
| 41 | - $this->laravel['config']['support.optimus'] = $values; |
|
| 41 | + $this->laravel[ 'config' ][ 'support.optimus' ] = $values; |
|
| 42 | 42 | |
| 43 | 43 | $this->printValues($values); |
| 44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | protected function printValues($values) |
| 54 | 54 | { |
| 55 | - $this->table(array_keys($values), [array_values($values)]); |
|
| 55 | + $this->table(array_keys($values), [ array_values($values) ]); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /** |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | base_path('vendor/mews/captcha/config/captcha.php') => config_path('captcha.php'), |
| 16 | 16 | ], 'config'); |
| 17 | 17 | |
| 18 | - $this->app['validator']->extend('captcha', function ($attribute, $value, $parameters) { |
|
| 18 | + $this->app[ 'validator' ]->extend('captcha', function($attribute, $value, $parameters) { |
|
| 19 | 19 | return captcha_check($value); |
| 20 | 20 | }); |
| 21 | 21 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | { |
| 20 | 20 | $inputs = $request->input(); |
| 21 | 21 | |
| 22 | - array_walk_recursive($inputs, function (&$value) { |
|
| 22 | + array_walk_recursive($inputs, function(&$value) { |
|
| 23 | 23 | $value = trim($value); |
| 24 | 24 | }); |
| 25 | 25 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | { |
| 40 | 40 | $extension = ExtensionGuesser::getInstance()->guess($mimeType); |
| 41 | 41 | |
| 42 | - if (! is_null($extension)) { |
|
| 42 | + if (!is_null($extension)) { |
|
| 43 | 43 | if ('jpeg' == $extension) { |
| 44 | 44 | $extension = 'jpg'; |
| 45 | 45 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | ]; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - return isset($iDeviceModels[$platform]) ? $iDeviceModels[$platform] : $platform; |
|
| 145 | + return isset($iDeviceModels[ $platform ]) ? $iDeviceModels[ $platform ] : $platform; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -166,9 +166,9 @@ discard block |
||
| 166 | 166 | 'vip.sina.com' => 'http://mail.sina.com.cn', |
| 167 | 167 | ]; |
| 168 | 168 | |
| 169 | - $domain = strtolower($match[1]); |
|
| 169 | + $domain = strtolower($match[ 1 ]); |
|
| 170 | 170 | |
| 171 | - return isset($list[$domain]) ? $list[$domain] : 'http://mail.'.$domain; |
|
| 171 | + return isset($list[ $domain ]) ? $list[ $domain ] : 'http://mail.'.$domain; |
|
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | $random = str_random(strlen($text)); |
| 191 | 191 | |
| 192 | 192 | // 按字符拼接:随机字符串 + 随机字符串异或原文 |
| 193 | - $tmp = static::sampleEncryption($text, $random, function ($a, $b) { |
|
| 193 | + $tmp = static::sampleEncryption($text, $random, function($a, $b) { |
|
| 194 | 194 | return $b.($a ^ $b); |
| 195 | 195 | }); |
| 196 | 196 | |
@@ -217,7 +217,7 @@ discard block |
||
| 217 | 217 | $tmpLength = strlen($tmp); |
| 218 | 218 | $result = ''; |
| 219 | 219 | for ($i = 0; $i < $tmpLength, ($i + 1) < $tmpLength; $i += 2) { |
| 220 | - $result .= $tmp[$i] ^ $tmp[$i + 1]; |
|
| 220 | + $result .= $tmp[ $i ] ^ $tmp[ $i + 1 ]; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | return $result; |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | $key = (string) $key; |
| 243 | 243 | $keyLength = strlen($key); |
| 244 | 244 | if (is_null($callback)) { |
| 245 | - $callback = function ($a, $b) { |
|
| 245 | + $callback = function($a, $b) { |
|
| 246 | 246 | return $a ^ $b; |
| 247 | 247 | }; |
| 248 | 248 | } |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | $result = ''; |
| 251 | 251 | $textLength = strlen($text); |
| 252 | 252 | for ($i = 0; $i < $textLength; $i++) { |
| 253 | - $tmp = $callback($text[$i], $key[$i % $keyLength], $i); |
|
| 253 | + $tmp = $callback($text[ $i ], $key[ $i % $keyLength ], $i); |
|
| 254 | 254 | if (false === $tmp) { |
| 255 | 255 | break; |
| 256 | 256 | } |
@@ -285,10 +285,10 @@ discard block |
||
| 285 | 285 | while ($number >= $charactersLength) { |
| 286 | 286 | $mod = (int) bcmod($number, $charactersLength); |
| 287 | 287 | $number = (int) bcdiv($number, $charactersLength); |
| 288 | - $string = $characters[$mod].$string; |
|
| 288 | + $string = $characters[ $mod ].$string; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - return $characters[$number].$string; |
|
| 291 | + return $characters[ $number ].$string; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | /** |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | $number = 0; |
| 312 | 312 | for ($i = 0; $i < $stringLength; $i++) { |
| 313 | - $index = strpos($characters, $string[$i]); |
|
| 313 | + $index = strpos($characters, $string[ $i ]); |
|
| 314 | 314 | $number = (int) bcadd($number, bcmul($index, bcpow($charactersLength, $i))); |
| 315 | 315 | } |
| 316 | 316 | |