@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $kernel = $this->app->make(Kernel::class); |
22 | 22 | $kernel->prependMiddleware(Middleware::class); |
23 | 23 | } elseif ($this->app instanceof LumenApplication) { |
24 | - $this->app->middleware([Middleware::class]); |
|
24 | + $this->app->middleware([ Middleware::class ]); |
|
25 | 25 | } |
26 | 26 | } |
27 | 27 | |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $source = realpath($raw = __DIR__.'/../config/httpSecurity.php') ?: $raw; |
36 | 36 | |
37 | 37 | if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { |
38 | - $this->publishes([$source => config_path('httpSecurity.php')]); |
|
38 | + $this->publishes([ $source => config_path('httpSecurity.php') ]); |
|
39 | 39 | } elseif ($this->app instanceof LumenApplication) { |
40 | 40 | $this->app->configure('httpSecurity'); |
41 | 41 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | continue; |
57 | 57 | } |
58 | 58 | |
59 | - $method->invokeArgs($this, [$request, $response]); |
|
59 | + $method->invokeArgs($this, [ $request, $response ]); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | return $response; |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | |
89 | 89 | protected function buildCacheKey($key) |
90 | 90 | { |
91 | - return "HttpSecurity:" . md5(serialize($key)); |
|
91 | + return "HttpSecurity:".md5(serialize($key)); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | } |
234 | 234 | |
235 | 235 | // 去匹配允许的条件, 如果 allowedPatterns 为空直接通过 |
236 | - $allowPatterns = $this->getGuardConfig('refererHotlinking.allowPatterns', []); |
|
236 | + $allowPatterns = $this->getGuardConfig('refererHotlinking.allowPatterns', [ ]); |
|
237 | 237 | $allow = $allow || empty($allowPatterns); |
238 | 238 | foreach ($allowPatterns as $pathPattern => $refererPatterns) { |
239 | 239 | if ($allow) { |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | |
251 | 251 | // 不允许的 |
252 | - $forbidPatterns = $this->getGuardConfig('refererHotlinking.forbidPatterns', []); |
|
252 | + $forbidPatterns = $this->getGuardConfig('refererHotlinking.forbidPatterns', [ ]); |
|
253 | 253 | foreach ($forbidPatterns as $pathPattern => $refererPatterns) { |
254 | 254 | if (!$allow) { |
255 | 255 | break; |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | $allow = false; |
339 | 339 | |
340 | 340 | // 去匹配允许条件, 如果 allowedIps 为空直接通过 |
341 | - $allowedIps = $this->getGuardConfig('ipAccess.allowedIps', []); |
|
341 | + $allowedIps = $this->getGuardConfig('ipAccess.allowedIps', [ ]); |
|
342 | 342 | $allow = ($allow || empty($allowedIps)); |
343 | 343 | foreach ($allowedIps as $pathPattern => $ipPatterns) { |
344 | 344 | if ($allow) { |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | } |
355 | 355 | |
356 | 356 | // 不允许的 |
357 | - $forbidPatterns = $this->getGuardConfig('ipAccess.forbidIps', []); |
|
357 | + $forbidPatterns = $this->getGuardConfig('ipAccess.forbidIps', [ ]); |
|
358 | 358 | foreach ($forbidPatterns as $pathPattern => $ipPatterns) { |
359 | 359 | if (!$allow) { |
360 | 360 | break; |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | 'enable' => true, |
94 | 94 | 'allowEmpty' => true, |
95 | 95 | 'allowedPatterns' => [ |
96 | - '*' => ['*'], |
|
96 | + '*' => [ '*' ], |
|
97 | 97 | ], |
98 | 98 | |
99 | - 'forbidPatterns' => [], |
|
99 | + 'forbidPatterns' => [ ], |
|
100 | 100 | ], |
101 | 101 | |
102 | 102 | 'clientIpChange' => [ |
@@ -114,6 +114,6 @@ discard block |
||
114 | 114 | '*' => '*', |
115 | 115 | ], |
116 | 116 | |
117 | - 'forbidIps' => [], |
|
117 | + 'forbidIps' => [ ], |
|
118 | 118 | ], |
119 | 119 | ]; |