@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | protected function checkExpiration() |
121 | 121 | { |
122 | - $this->enabledItems->each(function ($index, $type) { |
|
122 | + $this->enabledItems->each(function($index, $type) { |
|
123 | 123 | $now = (string) $this->now(); |
124 | 124 | $last = (string) $this->record[$type]['lastRequestAt']; |
125 | 125 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function increment() |
212 | 212 | { |
213 | - $this->enabledItems->each(function ($index, $type) { |
|
213 | + $this->enabledItems->each(function($index, $type) { |
|
214 | 214 | $this->save($type, ['requestCount' => $this->record[$type]['requestCount'] + 1]); |
215 | 215 | }); |
216 | 216 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | protected function isAttack() |
224 | 224 | { |
225 | - return $this->enabledItems->filter(function ($index, $type) { |
|
225 | + return $this->enabledItems->filter(function($index, $type) { |
|
226 | 226 | if (!$this->isWhitelisted($type) && $this->record[$type]['requestCount'] > $this->getMaxRequestCountForType($type)) { |
227 | 227 | $this->takeAction($this->record[$type]); |
228 | 228 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | private function loadConfig() |
281 | 281 | { |
282 | - $this->enabledItems = collect($this->config()->get('attack_blocker.enabled'))->filter(function ($item) { |
|
282 | + $this->enabledItems = collect($this->config()->get('attack_blocker.enabled'))->filter(function($item) { |
|
283 | 283 | return $item === true; |
284 | 284 | }); |
285 | 285 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | */ |
310 | 310 | protected function loadRecordItems() |
311 | 311 | { |
312 | - $this->enabledItems->each(function ($index, $type) { |
|
312 | + $this->enabledItems->each(function($index, $type) { |
|
313 | 313 | if (is_null($this->record[$type] = $this->cache()->get($key = $this->makeKeyForType($type, $this->ipAddress)))) { |
314 | 314 | $this->record[$type] = $this->getEmptyRecord($key, $type); |
315 | 315 | } |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | if (!$record['wasNotified'] && $this->config()->get('notifications.enabled')) { |
463 | 463 | $this->save($record['type'], ['wasNotified' => true]); |
464 | 464 | |
465 | - collect($this->config()->get('notifications.channels'))->filter(function ($value, $channel) use ($record) { |
|
465 | + collect($this->config()->get('notifications.channels'))->filter(function($value, $channel) use ($record) { |
|
466 | 466 | try { |
467 | 467 | event(new AttackDetected($record, $channel)); |
468 | 468 | } catch (\Exception $exception) { |