@@ -17,7 +17,7 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | public function boot(Router $router) |
| 19 | 19 | { |
| 20 | - if( function_exists('config_path') ) { |
|
| 20 | + if (function_exists('config_path')) { |
|
| 21 | 21 | $this->publishes([ |
| 22 | 22 | __DIR__ . '/../config/apikey.php' => config_path('apikey.php'), |
| 23 | 23 | ], 'config'); |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $name = $appClient->name; |
| 58 | 58 | |
| 59 | 59 | $options = $this->options(); |
| 60 | - $options = Arr::where($options, function ($option) { |
|
| 60 | + $options = Arr::where($options, function($option) { |
|
| 61 | 61 | if ($option) { |
| 62 | 62 | return $option; |
| 63 | 63 | } |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | $headers = ['AppName', 'AppId', 'Secret', 'Status', 'CreateAt']; |
| 51 | 51 | |
| 52 | - $rows = $lists->map(function ($list) { |
|
| 52 | + $rows = $lists->map(function($list) { |
|
| 53 | 53 | $status = $list->active ? 'active' : 'deactivated'; |
| 54 | 54 | $status = $list->trashed() ? 'deleted' : $status; |
| 55 | 55 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('api_auth_access_events', function (Blueprint $table) { |
|
| 16 | + Schema::create('api_auth_access_events', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->string('appid')->comment('Appid'); |
| 19 | 19 | $table->ipAddress('ip_address')->comment('IP'); |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public function up() |
| 15 | 15 | { |
| 16 | - Schema::create('api_auth_oprate_events', function (Blueprint $table) { |
|
| 16 | + Schema::create('api_auth_oprate_events', function(Blueprint $table) { |
|
| 17 | 17 | $table->increments('id'); |
| 18 | 18 | $table->unsignedInteger('app_client_id'); |
| 19 | 19 | $table->ipAddress('ip_address'); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function up() |
| 16 | 16 | { |
| 17 | - Schema::create('app_clients', function (Blueprint $table) { |
|
| 17 | + Schema::create('app_clients', function(Blueprint $table) { |
|
| 18 | 18 | $table->increments('id'); |
| 19 | 19 | $table->string('name')->comment('AppName'); |
| 20 | 20 | $table->string('appid')->comment('Appid'); |
@@ -111,13 +111,13 @@ discard block |
||
| 111 | 111 | if (!$prefix) { |
| 112 | 112 | if ($prepend) { |
| 113 | 113 | $this->fallbackDirsPsr0 = array_merge( |
| 114 | - (array) $paths, |
|
| 114 | + (array)$paths, |
|
| 115 | 115 | $this->fallbackDirsPsr0 |
| 116 | 116 | ); |
| 117 | 117 | } else { |
| 118 | 118 | $this->fallbackDirsPsr0 = array_merge( |
| 119 | 119 | $this->fallbackDirsPsr0, |
| 120 | - (array) $paths |
|
| 120 | + (array)$paths |
|
| 121 | 121 | ); |
| 122 | 122 | } |
| 123 | 123 | |
@@ -126,19 +126,19 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $first = $prefix[0]; |
| 128 | 128 | if (!isset($this->prefixesPsr0[$first][$prefix])) { |
| 129 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
| 129 | + $this->prefixesPsr0[$first][$prefix] = (array)$paths; |
|
| 130 | 130 | |
| 131 | 131 | return; |
| 132 | 132 | } |
| 133 | 133 | if ($prepend) { |
| 134 | 134 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
| 135 | - (array) $paths, |
|
| 135 | + (array)$paths, |
|
| 136 | 136 | $this->prefixesPsr0[$first][$prefix] |
| 137 | 137 | ); |
| 138 | 138 | } else { |
| 139 | 139 | $this->prefixesPsr0[$first][$prefix] = array_merge( |
| 140 | 140 | $this->prefixesPsr0[$first][$prefix], |
| 141 | - (array) $paths |
|
| 141 | + (array)$paths |
|
| 142 | 142 | ); |
| 143 | 143 | } |
| 144 | 144 | } |
@@ -159,13 +159,13 @@ discard block |
||
| 159 | 159 | // Register directories for the root namespace. |
| 160 | 160 | if ($prepend) { |
| 161 | 161 | $this->fallbackDirsPsr4 = array_merge( |
| 162 | - (array) $paths, |
|
| 162 | + (array)$paths, |
|
| 163 | 163 | $this->fallbackDirsPsr4 |
| 164 | 164 | ); |
| 165 | 165 | } else { |
| 166 | 166 | $this->fallbackDirsPsr4 = array_merge( |
| 167 | 167 | $this->fallbackDirsPsr4, |
| 168 | - (array) $paths |
|
| 168 | + (array)$paths |
|
| 169 | 169 | ); |
| 170 | 170 | } |
| 171 | 171 | } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
@@ -175,18 +175,18 @@ discard block |
||
| 175 | 175 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
| 176 | 176 | } |
| 177 | 177 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
| 178 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 178 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
| 179 | 179 | } elseif ($prepend) { |
| 180 | 180 | // Prepend directories for an already registered namespace. |
| 181 | 181 | $this->prefixDirsPsr4[$prefix] = array_merge( |
| 182 | - (array) $paths, |
|
| 182 | + (array)$paths, |
|
| 183 | 183 | $this->prefixDirsPsr4[$prefix] |
| 184 | 184 | ); |
| 185 | 185 | } else { |
| 186 | 186 | // Append directories for an already registered namespace. |
| 187 | 187 | $this->prefixDirsPsr4[$prefix] = array_merge( |
| 188 | 188 | $this->prefixDirsPsr4[$prefix], |
| 189 | - (array) $paths |
|
| 189 | + (array)$paths |
|
| 190 | 190 | ); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -201,9 +201,9 @@ discard block |
||
| 201 | 201 | public function set($prefix, $paths) |
| 202 | 202 | { |
| 203 | 203 | if (!$prefix) { |
| 204 | - $this->fallbackDirsPsr0 = (array) $paths; |
|
| 204 | + $this->fallbackDirsPsr0 = (array)$paths; |
|
| 205 | 205 | } else { |
| 206 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
| 206 | + $this->prefixesPsr0[$prefix[0]][$prefix] = (array)$paths; |
|
| 207 | 207 | } |
| 208 | 208 | } |
| 209 | 209 | |
@@ -219,14 +219,14 @@ discard block |
||
| 219 | 219 | public function setPsr4($prefix, $paths) |
| 220 | 220 | { |
| 221 | 221 | if (!$prefix) { |
| 222 | - $this->fallbackDirsPsr4 = (array) $paths; |
|
| 222 | + $this->fallbackDirsPsr4 = (array)$paths; |
|
| 223 | 223 | } else { |
| 224 | 224 | $length = strlen($prefix); |
| 225 | 225 | if ('\\' !== $prefix[$length - 1]) { |
| 226 | 226 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
| 227 | 227 | } |
| 228 | 228 | $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
| 229 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
| 229 | + $this->prefixDirsPsr4[$prefix] = (array)$paths; |
|
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | return false; |
| 343 | 343 | } |
| 344 | 344 | if (null !== $this->apcuPrefix) { |
| 345 | - $file = apcu_fetch($this->apcuPrefix.$class, $hit); |
|
| 345 | + $file = apcu_fetch($this->apcuPrefix . $class, $hit); |
|
| 346 | 346 | if ($hit) { |
| 347 | 347 | return $file; |
| 348 | 348 | } |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | if (null !== $this->apcuPrefix) { |
| 359 | - apcu_add($this->apcuPrefix.$class, $file); |
|
| 359 | + apcu_add($this->apcuPrefix . $class, $file); |
|
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | if (false === $file) { |
@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ComposerStaticInit503a57c988d2723fb22fc82fe9083963 |
| 8 | 8 | { |
| 9 | - public static $files = array ( |
|
| 9 | + public static $files = array( |
|
| 10 | 10 | '38bc130034b61d96d3a0ad0c9a8d5950' => __DIR__ . '/../..' . '/src/helper.php', |
| 11 | 11 | ); |
| 12 | 12 | |
| 13 | - public static $prefixLengthsPsr4 = array ( |
|
| 13 | + public static $prefixLengthsPsr4 = array( |
|
| 14 | 14 | 'A' => |
| 15 | - array ( |
|
| 15 | + array( |
|
| 16 | 16 | 'ArcherZdip\\LaravelApiAuth\\' => 26, |
| 17 | 17 | ), |
| 18 | 18 | ); |
| 19 | 19 | |
| 20 | - public static $prefixDirsPsr4 = array ( |
|
| 20 | + public static $prefixDirsPsr4 = array( |
|
| 21 | 21 | 'ArcherZdip\\LaravelApiAuth\\' => |
| 22 | - array ( |
|
| 22 | + array( |
|
| 23 | 23 | 0 => __DIR__ . '/../..' . '/src', |
| 24 | 24 | ), |
| 25 | 25 | ); |
| 26 | 26 | |
| 27 | 27 | public static function getInitializer(ClassLoader $loader) |
| 28 | 28 | { |
| 29 | - return \Closure::bind(function () use ($loader) { |
|
| 29 | + return \Closure::bind(function() use ($loader) { |
|
| 30 | 30 | $loader->prefixLengthsPsr4 = ComposerStaticInit503a57c988d2723fb22fc82fe9083963::$prefixLengthsPsr4; |
| 31 | 31 | $loader->prefixDirsPsr4 = ComposerStaticInit503a57c988d2723fb22fc82fe9083963::$prefixDirsPsr4; |
| 32 | 32 | |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | protected function createSign(string $appid, int $exp): string |
| 122 | 122 | { |
| 123 | 123 | $secret = $this->checkAppId($appid)->secret; |
| 124 | - return sha1($appid . $secret . (string) $exp); |
|
| 124 | + return sha1($appid . $secret . (string)$exp); |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | /** |