Test Failed
Push — 2.x ( 445986...358314 )
by Terry
10:40
created
src/Firewall/Component/Rdns.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     public function isDenied(): bool
46 46
     {
47 47
         if (!empty($this->deniedList)) {
48
-            if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->rdns)) {
48
+            if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->rdns)) {
49 49
                 return true;
50 50
             }
51 51
         }
Please login to merge, or discard this patch.
src/Firewall/Component/UserAgent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
         $this->deniedList = [
50 50
 
51 51
             // Backlink crawlers
52
-            'Ahrefs',     // http://ahrefs.com/robot/
53
-            'roger',      // rogerbot (SEOMOZ)
54
-            'moz.com',    // SEOMOZ crawlers
55
-            'MJ12bot',    // Majestic crawlers
56
-            'findlinks',  // http://wortschatz.uni-leipzig.de/findlinks
57
-            'Semrush',    // http://www.semrush.com/bot.html
52
+            'Ahrefs', // http://ahrefs.com/robot/
53
+            'roger', // rogerbot (SEOMOZ)
54
+            'moz.com', // SEOMOZ crawlers
55
+            'MJ12bot', // Majestic crawlers
56
+            'findlinks', // http://wortschatz.uni-leipzig.de/findlinks
57
+            'Semrush', // http://www.semrush.com/bot.html
58 58
     
59 59
             // Web information crawlers
60
-            'domain',     // Domain name information crawlers.
61
-            'copyright',  // Copyright information crawlers.
60
+            'domain', // Domain name information crawlers.
61
+            'copyright', // Copyright information crawlers.
62 62
     
63 63
             // Others
64
-            'archive',    // Wayback machine
64
+            'archive', // Wayback machine
65 65
         ];
66 66
     }
67 67
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function isDenied(): bool
72 72
     {
73 73
         if (!empty($this->deniedList)) {
74
-            if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $this->userAgent)) {
74
+            if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $this->userAgent)) {
75 75
                 return true;
76 76
             }
77 77
         }
Please login to merge, or discard this patch.
src/Firewall/Middleware/UserAgent.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -50,19 +50,19 @@  discard block
 block discarded – undo
50 50
     protected $deniedList = [
51 51
 
52 52
         // Backlink crawlers
53
-        'Ahrefs',     // http://ahrefs.com/robot/
54
-        'roger',      // rogerbot (SEOMOZ)
55
-        'moz.com',    // SEOMOZ crawlers
56
-        'MJ12bot',    // Majestic crawlers
57
-        'findlinks',  // http://wortschatz.uni-leipzig.de/findlinks
58
-        'Semrush',    // http://www.semrush.com/bot.html
53
+        'Ahrefs', // http://ahrefs.com/robot/
54
+        'roger', // rogerbot (SEOMOZ)
55
+        'moz.com', // SEOMOZ crawlers
56
+        'MJ12bot', // Majestic crawlers
57
+        'findlinks', // http://wortschatz.uni-leipzig.de/findlinks
58
+        'Semrush', // http://www.semrush.com/bot.html
59 59
 
60 60
         // Web information crawlers
61
-        'domain',     // Domain name information crawlers.
62
-        'copyright',  // Copyright information crawlers.
61
+        'domain', // Domain name information crawlers.
62
+        'copyright', // Copyright information crawlers.
63 63
 
64 64
         // Others
65
-        'archive',    // Wayback machine
65
+        'archive', // Wayback machine
66 66
     ];
67 67
 
68 68
     /**
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         }
97 97
 
98 98
         if (!empty($this->deniedList)) {
99
-            if (preg_match('/(' . implode('|', $this->deniedList). ')/i', $userAgent)) {
99
+            if (preg_match('/(' . implode('|', $this->deniedList) . ')/i', $userAgent)) {
100 100
                 return (new Response)->withStatus(self::HTTP_STATUS_CODE);
101 101
             }
102 102
         }
Please login to merge, or discard this patch.
src/Firewall/Driver/RedisDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -274,8 +274,8 @@
 block discarded – undo
274 274
     {
275 275
         $table = [
276 276
             'filter'  => $this->tableFilterLogs . ':' . $ip,
277
-            'session' => $this->tableSessions   . ':' . $ip,
278
-            'rule'    => $this->tableRuleList   . ':' . $ip,
277
+            'session' => $this->tableSessions . ':' . $ip,
278
+            'rule'    => $this->tableRuleList . ':' . $ip,
279 279
         ];
280 280
         
281 281
         return $table[$type] ?? '';
Please login to merge, or discard this patch.
src/Firewall/Driver/FileDriverTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -100,8 +100,8 @@
 block discarded – undo
100 100
         $path = [];
101 101
 
102 102
         $path['filter']  = $this->directory . '/' . $this->tableFilterLogs . '/' . $ip . '.' . $this->extension;
103
-        $path['session'] = $this->directory . '/' . $this->tableSessions   . '/' . $ip . '.' . $this->extension;
104
-        $path['rule']    = $this->directory . '/' . $this->tableRuleList   . '/' . $ip . '.' . $this->extension;
103
+        $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension;
104
+        $path['rule']    = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension;
105 105
 
106 106
         return $path[$type] ?? '';
107 107
     }
Please login to merge, or discard this patch.
src/Firewall/Kernel/DriverTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
             $this->driver->setChannel($channel);
106 106
         } else {
107 107
             Event::AddListener('set_driver',
108
-                function ($args) use ($channel) {
108
+                function($args) use ($channel) {
109 109
                     $args['driver']->setChannel($channel);
110 110
                 }
111 111
             );
Please login to merge, or discard this patch.
src/Firewall/FirewallTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
             $channel = '_' . $this->channel;
273 273
         }
274 274
 
275
-        return $this->directory . '/' . $this->version . $channel .  '_' . $driverType . '_' . $this->checkpoint;
275
+        return $this->directory . '/' . $this->version . $channel . '_' . $driverType . '_' . $this->checkpoint;
276 276
     }
277 277
 
278 278
     /**
Please login to merge, or discard this patch.
src/Firewall/Firewall/SetupTrait.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             if (empty($ip))
317 317
                 continue;
318 318
 
319
-            if (0 === strpos($this->kernel->getCurrentUrl(), empty($ip['url']) ? '/' : $ip['url']) ) {
319
+            if (0 === strpos($this->kernel->getCurrentUrl(), empty($ip['url']) ? '/' : $ip['url'])) {
320 320
 
321 321
                 if ('allow' === $ip['rule']) {
322 322
                     $allowedList[] = $ip['ip'];
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
         $this->kernel->setProperty(
379 379
             'deny_attempt_enable',
380 380
             [
381
-                'data_circle'     => $setting['data_circle']['enable'],     // false   
381
+                'data_circle'     => $setting['data_circle']['enable'], // false   
382 382
                 'system_firewall' => $setting['system_firewall']['enable'], // false   
383 383
             ]
384 384
         );
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
         $this->kernel->setProperty(
387 387
             'deny_attempt_buffer',
388 388
             [
389
-                'data_circle'     => $setting['data_circle']['buffer'],     // 10
389
+                'data_circle'     => $setting['data_circle']['buffer'], // 10
390 390
                 'system_firewall' => $setting['system_firewall']['buffer'], // 10
391 391
             ]
392 392
         );
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 
432 432
         if ($sessionLimitSetting['enable']) {
433 433
 
434
-            $onlineUsers = $sessionLimitSetting['config']['count'];       // default: 100
435
-            $alivePeriod = $sessionLimitSetting['config']['period'];      // default: 300
434
+            $onlineUsers = $sessionLimitSetting['config']['count']; // default: 100
435
+            $alivePeriod = $sessionLimitSetting['config']['period']; // default: 300
436 436
             $isUniqueIp  = $sessionLimitSetting['config']['unique_only']; // false
437 437
 
438 438
             $this->kernel->limitSession($onlineUsers, $alivePeriod, $isUniqueIp);
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 
456 456
             $lastResetTime = $cronjobSetting['config']['last_update'];
457 457
 
458
-            if (!empty($lastResetTime) ) {
458
+            if (!empty($lastResetTime)) {
459 459
                 $lastResetTime = strtotime($lastResetTime);
460 460
             } else {
461 461
                 // @codeCoverageIgnoreStart
@@ -535,8 +535,8 @@  discard block
 block discarded – undo
535 535
         $dialogInfo = $this->getOption('dialog_info_disclosure');
536 536
 
537 537
         $this->kernel->setProperty('display_online_info', $dialogInfo['online_user_amount']);
538
-        $this->kernel->setProperty('display_user_info',   $dialogInfo['user_inforamtion']);
539
-        $this->kernel->setProperty('display_http_code',   $dialogInfo['http_status_code']);
538
+        $this->kernel->setProperty('display_user_info', $dialogInfo['user_inforamtion']);
539
+        $this->kernel->setProperty('display_http_code', $dialogInfo['http_status_code']);
540 540
         $this->kernel->setProperty('display_reason_code', $dialogInfo['reason_code']);
541 541
         $this->kernel->setProperty('display_reason_text', $dialogInfo['reason_text']);
542 542
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -313,8 +313,9 @@
 block discarded – undo
313 313
         $deniedList = [];
314 314
 
315 315
         foreach ($ipList as $ip) {
316
-            if (empty($ip))
317
-                continue;
316
+            if (empty($ip)) {
317
+                            continue;
318
+            }
318 319
 
319 320
             if (0 === strpos($this->kernel->getCurrentUrl(), empty($ip['url']) ? '/' : $ip['url']) ) {
320 321
 
Please login to merge, or discard this patch.
src/Firewall/Log/ActionLogParser.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -347,18 +347,18 @@  discard block
 block discarded – undo
347 347
 
348 348
         $results['captcha_chart_string']       = ''; // string
349 349
         $results['pageview_chart_string']      = ''; // string
350
-        $results['captcha_success_count']      = 0;  // integer
351
-        $results['captcha_failure_count']      = 0;  // integer
352
-        $results['captcha_count']              = 0;  // integer
353
-        $results['pageview_count']             = 0;  // integer
354
-        $results['captcha_percentageage']      = 0;  // integer
355
-        $results['captcha_failure_percentage'] = 0;  // integer
356
-        $results['captcha_success_percentage'] = 0;  // integer
357
-        $results['action_ban_count']           = 0;  // integer
358
-        $results['action_temp_ban_count']      = 0;  // integer
359
-        $results['action_unban_count']         = 0;  // integer
360
-        $results['blacklist_count']            = 0;  // integer
361
-        $results['session_limit_count']        = 0;  // integer
350
+        $results['captcha_success_count']      = 0; // integer
351
+        $results['captcha_failure_count']      = 0; // integer
352
+        $results['captcha_count']              = 0; // integer
353
+        $results['pageview_count']             = 0; // integer
354
+        $results['captcha_percentageage']      = 0; // integer
355
+        $results['captcha_failure_percentage'] = 0; // integer
356
+        $results['captcha_success_percentage'] = 0; // integer
357
+        $results['action_ban_count']           = 0; // integer
358
+        $results['action_temp_ban_count']      = 0; // integer
359
+        $results['action_unban_count']         = 0; // integer
360
+        $results['blacklist_count']            = 0; // integer
361
+        $results['session_limit_count']        = 0; // integer
362 362
 
363 363
         $ipdData = $this->getIpData();
364 364
 
@@ -407,18 +407,18 @@  discard block
 block discarded – undo
407 407
         $results['label_chart_string']         = ''; // string
408 408
         $results['captcha_chart_string']       = ''; // string
409 409
         $results['pageview_chart_string']      = ''; // string
410
-        $results['captcha_success_count']      = 0;  // integer
411
-        $results['captcha_failure_count']      = 0;  // integer
412
-        $results['captcha_count']              = 0;  // integer
413
-        $results['pageview_count']             = 0;  // integer
414
-        $results['captcha_percentageage']      = 0;  // integer
415
-        $results['captcha_failure_percentage'] = 0;  // integer
416
-        $results['captcha_success_percentage'] = 0;  // integer
417
-        $results['action_ban_count']           = 0;  // integer
418
-        $results['action_temp_ban_count']      = 0;  // integer
419
-        $results['action_unban_count']         = 0;  // integer
420
-        $results['blacklist_count']            = 0;  // integer
421
-        $results['session_limit_count']        = 0;  // integer
410
+        $results['captcha_success_count']      = 0; // integer
411
+        $results['captcha_failure_count']      = 0; // integer
412
+        $results['captcha_count']              = 0; // integer
413
+        $results['pageview_count']             = 0; // integer
414
+        $results['captcha_percentageage']      = 0; // integer
415
+        $results['captcha_failure_percentage'] = 0; // integer
416
+        $results['captcha_success_percentage'] = 0; // integer
417
+        $results['action_ban_count']           = 0; // integer
418
+        $results['action_temp_ban_count']      = 0; // integer
419
+        $results['action_unban_count']         = 0; // integer
420
+        $results['blacklist_count']            = 0; // integer
421
+        $results['session_limit_count']        = 0; // integer
422 422
 
423 423
         if (!empty($periodData)) {
424 424
             $chartCaptcha = [];
@@ -483,7 +483,7 @@  discard block
 block discarded – undo
483 483
         $ip = $log['ip'];
484 484
         $sessionId = $log['session_id'];
485 485
 
486
-        $this->ipDetail[$t][$ip]['session_id'][$sessionId ] = 1;
486
+        $this->ipDetail[$t][$ip]['session_id'][$sessionId] = 1;
487 487
 
488 488
         if ($logActionCode === self::LOG_TEMPORARILY_BAN) {
489 489
             $this->periodDetail[$t][$k]['action_temp_ban_count']++;
Please login to merge, or discard this patch.