Test Failed
Push — 2.x ( 9b487d...4021d6 )
by Terry
16:06
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/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/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.
src/Firewall/Firewall/XssProtectionTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         if ($enable['post']) {
88 88
             $this->kernel->setClosure(
89 89
                 'xss_post',
90
-                function () use ($xss) {
90
+                function() use ($xss) {
91 91
                     if (!empty($_POST)) {
92 92
                         foreach (array_keys($_POST) as $k) {
93 93
                             $_POST[$k] = $xss->clean($_POST[$k]);
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         if ($enable['get']) {
112 112
             $this->kernel->setClosure(
113 113
                 'xss_get',
114
-                function () use ($xss) {
114
+                function() use ($xss) {
115 115
                     if (!empty($_GET)) {
116 116
                         foreach (array_keys($_GET) as $k) {
117 117
                             $_GET[$k] = $xss->clean($_GET[$k]);
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         if ($enable['cookie']) {
136 136
             $this->kernel->setClosure(
137 137
                 'xss_cookie',
138
-                function () use ($xss) {
138
+                function() use ($xss) {
139 139
                     if (!empty($_COOKIE)) {
140 140
                         foreach (array_keys($_COOKIE) as $k) {
141 141
                             $_COOKIE[$k] = $xss->clean($_COOKIE[$k]);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
         if (!empty($protectedList)) {
160 160
             $this->kernel->setClosure(
161 161
                 'xss_protection',
162
-                function () use ($xss, $protectedList) {
162
+                function() use ($xss, $protectedList) {
163 163
                     foreach ($protectedList as $v) {
164 164
                         $k = $v['variable'] ?? 'undefined';
165 165
         
Please login to merge, or discard this patch.
src/Firewall/Firewall/Driver/DriverFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
         $str = implode(
62 62
             '',
63 63
             array_map(
64
-                function ($word) {
64
+                function($word) {
65 65
                     return ucwords($word);
66 66
                 },
67 67
                 $str
Please login to merge, or discard this patch.