Passed
Push — master ( 678557...b90afe )
by Antonio Carlos
04:08
created
src/Support/AttackBlocker.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
      */
141 141
     protected function checkExpiration()
142 142
     {
143
-        $this->enabledItems->each(function ($index, $type) {
143
+        $this->enabledItems->each(function($index, $type) {
144 144
             if (($this->record[$type]['lastRequestAt']->diffInSeconds(Carbon::now())) <= ($this->getMaxSecondsForType($type))) {
145 145
                 return $this->record;
146 146
             }
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
      */
259 259
     protected function increment()
260 260
     {
261
-        $this->enabledItems->each(function ($index, $type) {
261
+        $this->enabledItems->each(function($index, $type) {
262 262
             $this->save($type, ['requestCount' => $this->record[$type]['requestCount'] + 1]);
263 263
         });
264 264
     }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
      */
271 271
     protected function isAttack()
272 272
     {
273
-        return $this->enabledItems->filter(function ($index, $type) {
273
+        return $this->enabledItems->filter(function($index, $type) {
274 274
             if (!$this->isWhitelisted($type) && $this->record[$type]['requestCount'] > $this->getMaxRequestCountForType($type)) {
275 275
                 $this->takeAction($this->record[$type]);
276 276
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      */
328 328
     private function loadConfig()
329 329
     {
330
-        $this->enabledItems = collect($this->config->get('attack_blocker.enabled'))->filter(function ($item) {
330
+        $this->enabledItems = collect($this->config->get('attack_blocker.enabled'))->filter(function($item) {
331 331
             return $item === true;
332 332
         });
333 333
     }
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
      */
358 358
     protected function loadRecordItems()
359 359
     {
360
-        $this->enabledItems->each(function ($index, $type) {
360
+        $this->enabledItems->each(function($index, $type) {
361 361
             if (is_null($this->record[$type] = $this->cache->get($key = $this->makeKeyForType($type, $this->ipAddress)))) {
362 362
                 $this->record[$type] = $this->getEmptyRecord($key, $type);
363 363
             }
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
         if (!$record['wasNotified'] && $this->config->get('notifications.enabled')) {
499 499
             $this->save($record['type'], ['wasNotified' => true]);
500 500
 
501
-            collect($this->config->get('notifications.channels'))->filter(function ($value, $channel) use ($record) {
501
+            collect($this->config->get('notifications.channels'))->filter(function($value, $channel) use ($record) {
502 502
                 try {
503 503
                     event(new AttackDetected($record, $channel));
504 504
                 } catch (\Exception $exception) {
Please login to merge, or discard this patch.