Passed
Push — 2.x ( a76a74...57e8e7 )
by Terry
02:45
created
src/Firewall/Driver/SqlDriverProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 
303 303
         // @codeCoverageIgnoreStart
304 304
         
305
-        } catch(Exception $e) {
305
+        } catch (Exception $e) {
306 306
             return false;
307 307
         }
308 308
 
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
         // @codeCoverageIgnoreStart
363 363
 
364
-        } catch(Exception $e) {
364
+        } catch (Exception $e) {
365 365
             return false;
366 366
         }
367 367
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
         // @codeCoverageIgnoreStart
416 416
 
417
-        } catch(Exception $e) {
417
+        } catch (Exception $e) {
418 418
             return false;
419 419
         }
420 420
 
Please login to merge, or discard this patch.
src/Firewall/Log/ActionLogParser.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             default:
209 209
 
210 210
                 // We also accept querying N days data from logs. For example: `past_365_days`.
211
-                if (preg_match('/past_([0-9]+)_days/', $this->type, $matches) ) {
211
+                if (preg_match('/past_([0-9]+)_days/', $this->type, $matches)) {
212 212
 
213 213
                     $dayCount = $matches[1];
214 214
                     $startDate = date('Ymd', strtotime('-' . $dayCount . ' days'));
@@ -331,21 +331,21 @@  discard block
 block discarded – undo
331 331
             return [];
332 332
         }
333 333
 
334
-        $results['captcha_chart_string']  = '';     // string
335
-        $results['pageview_chart_string'] = '';     // string
336
-        $results['captcha_success_count'] = 0;      // integer
337
-        $results['captcha_failure_count'] = 0;      // integer
338
-        $results['captcha_count'] = 0;              // integer
339
-        $results['pageview_count'] = 0;             // integer
340
-        $results['captcha_percentageage'] = 0;      // integer
334
+        $results['captcha_chart_string']  = ''; // string
335
+        $results['pageview_chart_string'] = ''; // string
336
+        $results['captcha_success_count'] = 0; // integer
337
+        $results['captcha_failure_count'] = 0; // integer
338
+        $results['captcha_count'] = 0; // integer
339
+        $results['pageview_count'] = 0; // integer
340
+        $results['captcha_percentageage'] = 0; // integer
341 341
         $results['captcha_failure_percentage'] = 0; // integer
342 342
         $results['captcha_success_percentage'] = 0; // integer
343 343
 
344
-        $results['action_ban_count'] = 0;           // integer
345
-        $results['action_temp_ban_count'] = 0;      // integer
346
-        $results['action_unban_count'] = 0;         // integer
347
-        $results['blacklist_count'] = 0;            // integer
348
-        $results['session_limit_count'] = 0;        // integer
344
+        $results['action_ban_count'] = 0; // integer
345
+        $results['action_temp_ban_count'] = 0; // integer
346
+        $results['action_unban_count'] = 0; // integer
347
+        $results['blacklist_count'] = 0; // integer
348
+        $results['session_limit_count'] = 0; // integer
349 349
 
350 350
         $ipdData = $this->getIpData();
351 351
 
@@ -386,22 +386,22 @@  discard block
 block discarded – undo
386 386
     {
387 387
         $periodData = $this->getPeriodData();
388 388
 
389
-        $results['captcha_chart_string']  = '';     // string
390
-        $results['pageview_chart_string'] = '';     // string
391
-        $results['label_chart_string'] = '';        // string
392
-        $results['captcha_success_count'] = 0;      // integer
393
-        $results['captcha_failure_count'] = 0;      // integer
394
-        $results['captcha_count'] = 0;              // integer
395
-        $results['pageview_count'] = 0;             // integer
396
-        $results['captcha_percentageage'] = 0;      // integer
389
+        $results['captcha_chart_string']  = ''; // string
390
+        $results['pageview_chart_string'] = ''; // string
391
+        $results['label_chart_string'] = ''; // string
392
+        $results['captcha_success_count'] = 0; // integer
393
+        $results['captcha_failure_count'] = 0; // integer
394
+        $results['captcha_count'] = 0; // integer
395
+        $results['pageview_count'] = 0; // integer
396
+        $results['captcha_percentageage'] = 0; // integer
397 397
         $results['captcha_failure_percentage'] = 0; // integer
398 398
         $results['captcha_success_percentage'] = 0; // integer
399 399
 
400
-        $results['action_ban_count'] = 0;           // integer
401
-        $results['action_temp_ban_count'] = 0;      // integer
402
-        $results['action_unban_count'] = 0;         // integer
403
-        $results['blacklist_count'] = 0;            // integer
404
-        $results['session_limit_count'] = 0;        // integer
400
+        $results['action_ban_count'] = 0; // integer
401
+        $results['action_temp_ban_count'] = 0; // integer
402
+        $results['action_unban_count'] = 0; // integer
403
+        $results['blacklist_count'] = 0; // integer
404
+        $results['session_limit_count'] = 0; // integer
405 405
 
406 406
         if (!empty($periodData)) {
407 407
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
             }
432 432
 
433 433
             $results['captcha_chart_string'] = implode(',', $chartCaptcha);
434
-            $results['pageview_chart_string']= implode(',', $chartPageview);
434
+            $results['pageview_chart_string'] = implode(',', $chartPageview);
435 435
             $results['captcha_success_chart_string'] = implode(',', $chartCaptchaSuccess);
436 436
             $results['captcha_failure_chart_string'] = implode(',', $chartCaptchaFailure);
437 437
             $results['label_chart_string'] = "'" . implode("','", $labels) . "'";
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         $ip = $log['ip'];
462 462
         $sessionId = $log['session_id'];
463 463
 
464
-        $this->ipDetail[$t][$ip]['session_id'][$sessionId ] = 1;
464
+        $this->ipDetail[$t][$ip]['session_id'][$sessionId] = 1;
465 465
 
466 466
         if ($logActionCode === self::LOG_TEMPORARILY_BAN) {
467 467
             $this->periodDetail[$t][$k]['action_temp_ban_count']++;
Please login to merge, or discard this patch.
src/Firewall/Log/ActionLogger.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -100,10 +100,10 @@
 block discarded – undo
100 100
             $record['session_id'] = substr($record['session_id'], 0, 4);
101 101
         }
102 102
 
103
-        $data[0] = $record['ip']          ?? 'null';
104
-        $data[1] = $record['session_id']  ?? 'null';
103
+        $data[0] = $record['ip'] ?? 'null';
104
+        $data[1] = $record['session_id'] ?? 'null';
105 105
         $data[2] = $record['action_code'] ?? 'null';
106
-        $data[3] = $record['timesamp']    ?? 'null';
106
+        $data[3] = $record['timesamp'] ?? 'null';
107 107
 
108 108
         file_put_contents($this->filePath, implode(',', $data) . "\n", FILE_APPEND | LOCK_EX);
109 109
     }
Please login to merge, or discard this patch.
templates/panel/table_sessions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             </div>
40 40
             <div class="board-field right">
41 41
                 <div class="heading"><?php _e('panel', 'table_heading_period', 'Period'); ?></div>
42
-                <div class="nums"><?php echo number_format($session_limit_period ); ?></div>
42
+                <div class="nums"><?php echo number_format($session_limit_period); ?></div>
43 43
                 <div class="note"><?php _e('panel', 'table_note_period', 'Keep-alive period. (minutes)'); ?></div>
44 44
             </div>
45 45
         </div>
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             </div>
50 50
             <div class="board-field right">
51 51
                 <div class="heading"><?php _e('panel', 'table_heading_online', 'Online'); ?></div>
52
-                <div class="nums"><?php echo number_format($online_count ); ?></div>
52
+                <div class="nums"><?php echo number_format($online_count); ?></div>
53 53
                 <div class="note"><?php _e('panel', 'table_note_online', 'Online session amount.'); ?></div>
54 54
             </div>
55 55
         </div>
@@ -89,14 +89,14 @@  discard block
 block discarded – undo
89 89
 
90 90
                         $remainsTime = $expires - (time() - $sessionInfo['time']);
91 91
 
92
-                        if ($remainsTime < 1 ) {
92
+                        if ($remainsTime < 1) {
93 93
                             $remainsTime = 0;
94 94
                         }
95 95
 
96
-                        if ($i < $session_limit_count ) {
96
+                        if ($i < $session_limit_count) {
97 97
                             $satusName = __('panel', 'table_text_allowable', 'Allowable');
98 98
 
99
-                            if ($remainsTime < 1 ) {
99
+                            if ($remainsTime < 1) {
100 100
                                 $satusName = __('panel', 'table_text_expired', 'Expired');
101 101
                             }
102 102
                         } else {
Please login to merge, or discard this patch.
templates/panel/action_log_today.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 ?>
19 19
 
20 20
 <div class="so-dashboard">
21
-    <?php if (! empty($period_data)) : ?>
21
+    <?php if (!empty($period_data)) : ?>
22 22
     <div class="so-flex">
23 23
         <div class="so-board">
24 24
             <div class="board-field left">
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 </tr>
89 89
             </thead>
90 90
             <tbody>
91
-                <?php if (! empty($ip_details)) : ?>
91
+                <?php if (!empty($ip_details)) : ?>
92 92
                 <?php foreach ($ip_details as $ip => $ipInfo) : ?>
93 93
                 <tr>
94 94
                     <td>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         </table>
112 112
     </div>
113 113
     <div class="so-timezone">
114
-        <?php if (! empty($last_cached_time)) : ?>
114
+        <?php if (!empty($last_cached_time)) : ?>
115 115
             <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong>
116 116
             &nbsp;&nbsp;&nbsp;&nbsp; 
117 117
         <?php endif; ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
 <?php
123 123
 
124
-    if (! empty($period_data)) {
124
+    if (!empty($period_data)) {
125 125
         $data['period_data'] = $period_data;
126 126
         $data['past_seven_hours'] = $past_seven_hours;
127 127
         $this->_include('panel/js/chart', $data);
Please login to merge, or discard this patch.
templates/panel/ip_manager.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         </div>
62 62
     </div>
63 63
     <br />
64
-    <?php if ( empty($ip_list)) : ?>
64
+    <?php if (empty($ip_list)) : ?>
65 65
     <div id="so-table-container" class="so-datatables">
66 66
         <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%">
67 67
             <tbody>
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                 </tr>
97 97
             </thead>
98 98
             <tbody>
99
-                <?php if (! empty($ip_list)) : ?>
99
+                <?php if (!empty($ip_list)) : ?>
100 100
                 <?php foreach ($ip_list as $i => $ipInfo) : ?>
101 101
                 <tr>
102 102
                     <td><?php echo $i + 1; ?></td>
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     </div>
120 120
 </div>
121 121
 
122
-<?php if (! empty($ip_list)) : ?>
122
+<?php if (!empty($ip_list)) : ?>
123 123
 
124 124
 <script>
125 125
 
Please login to merge, or discard this patch.
templates/panel/authentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@
 block discarded – undo
87 87
                 </tr>
88 88
             </thead>
89 89
             <tbody>
90
-                <?php if (! empty($authentication_list)) : ?>
90
+                <?php if (!empty($authentication_list)) : ?>
91 91
                 <?php foreach ($authentication_list as $i => $authInfo) : ?>
92 92
                 <tr>
93 93
                     <td><?php echo $authInfo['url']; ?></td>
Please login to merge, or discard this patch.
templates/panel/table_filter_logs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@
 block discarded – undo
58 58
             </thead>
59 59
             <tbody>
60 60
                 <?php foreach ($ip_log_list as $ipInfo) : ?>
61
-                    <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true ); ?>
61
+                    <?php $logData = is_array($ipInfo['log_data']) ? $ipInfo['log_data'] : json_decode($ipInfo['log_data'], true); ?>
62 62
                     <?php
63 63
 
64 64
                         $text_warning = '';
65 65
 
66
-                        if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100 ) {
66
+                        if ($logData['pageviews_m'] > 6 || $logData['pageviews_h'] > 50 || $logData['pageviews_d'] > 100) {
67 67
                             $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>';
68 68
                         }
69 69
 
70
-                        if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2 ) {
70
+                        if ($logData['flag_js_cookie'] > 2 || $logData['flag_multi_session'] > 2 || $logData['flag_empty_referer'] > 2) {
71 71
                             $text_warning = '<span class="so-text-warning"><i class="fas fa-exclamation-triangle"></i></span>';
72 72
                         }
73 73
 
74
-                        if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3 ) {
74
+                        if ($logData['flag_js_cookie'] > 3 || $logData['flag_multi_session'] > 3 || $logData['flag_empty_referer'] > 3) {
75 75
                             $text_warning = '<span class="so-text-danger"><i class="fas fa-exclamation-triangle"></i></span>';
76 76
                         }
77 77
                     ?>
Please login to merge, or discard this patch.
templates/panel/table_rules.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         </div>
68 68
     </div>
69 69
     <?php endif; ?>
70
-    <?php if (! empty($rule_list)) : ?>
70
+    <?php if (!empty($rule_list)) : ?>
71 71
     <div id="so-table-container" class="so-datatables" style="display: none;">
72 72
         <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%">
73 73
             <thead>
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
                     <td><?php echo $ipInfo['ip_resolve']; ?></td>
93 93
                     <td>
94 94
                         <?php 
95
-                            if (! empty($type_mapping[$ipInfo['type'] ]) ) {
96
-                                echo $type_mapping[$ipInfo['type'] ];
95
+                            if (!empty($type_mapping[$ipInfo['type']])) {
96
+                                echo $type_mapping[$ipInfo['type']];
97 97
                             }
98 98
                         ?>
99 99
                     </td>
100 100
                     <td>
101 101
                         <?php
102
-                            if (! empty($reason_mapping[$ipInfo['reason'] ]) ) {
103
-                                echo $reason_mapping[$ipInfo['reason'] ];
102
+                            if (!empty($reason_mapping[$ipInfo['reason']])) {
103
+                                echo $reason_mapping[$ipInfo['reason']];
104 104
                             }
105 105
                         ?>
106 106
                     </td>
Please login to merge, or discard this patch.