@@ -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 | if (($this->now()->diffInSeconds($this->record[$type]['lastRequestAt'])) <= ($this->getMaxSecondsForType($type))) { |
| 124 | 124 | return $this->record; |
| 125 | 125 | } |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | */ |
| 208 | 208 | protected function increment() |
| 209 | 209 | { |
| 210 | - $this->enabledItems->each(function ($index, $type) { |
|
| 210 | + $this->enabledItems->each(function($index, $type) { |
|
| 211 | 211 | $this->save($type, ['requestCount' => $this->record[$type]['requestCount'] + 1]); |
| 212 | 212 | }); |
| 213 | 213 | } |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | protected function isAttack() |
| 221 | 221 | { |
| 222 | - return $this->enabledItems->filter(function ($index, $type) { |
|
| 222 | + return $this->enabledItems->filter(function($index, $type) { |
|
| 223 | 223 | if (!$this->isWhitelisted($type) && $this->record[$type]['requestCount'] > $this->getMaxRequestCountForType($type)) { |
| 224 | 224 | $this->takeAction($this->record[$type]); |
| 225 | 225 | |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | */ |
| 277 | 277 | private function loadConfig() |
| 278 | 278 | { |
| 279 | - $this->enabledItems = collect($this->config()->get('attack_blocker.enabled'))->filter(function ($item) { |
|
| 279 | + $this->enabledItems = collect($this->config()->get('attack_blocker.enabled'))->filter(function($item) { |
|
| 280 | 280 | return $item === true; |
| 281 | 281 | }); |
| 282 | 282 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | */ |
| 307 | 307 | protected function loadRecordItems() |
| 308 | 308 | { |
| 309 | - $this->enabledItems->each(function ($index, $type) { |
|
| 309 | + $this->enabledItems->each(function($index, $type) { |
|
| 310 | 310 | if (is_null($this->record[$type] = $this->cache()->get($key = $this->makeKeyForType($type, $this->ipAddress)))) { |
| 311 | 311 | $this->record[$type] = $this->getEmptyRecord($key, $type); |
| 312 | 312 | } |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | if (!$record['wasNotified'] && $this->config()->get('notifications.enabled')) { |
| 460 | 460 | $this->save($record['type'], ['wasNotified' => true]); |
| 461 | 461 | |
| 462 | - collect($this->config()->get('notifications.channels'))->filter(function ($value, $channel) use ($record) { |
|
| 462 | + collect($this->config()->get('notifications.channels'))->filter(function($value, $channel) use ($record) { |
|
| 463 | 463 | event(new AttackDetected($record, $channel)); |
| 464 | 464 | }); |
| 465 | 465 | } |