Passed
Push — 2.x ( e86fd7...d9ee08 )
by Terry
02:59
created
src/Firewall/Panel/BaseController.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
             define('SHIELDON_VIEW', true);
165 165
         }
166 166
 
167
-        $viewFilePath =  __DIR__ . '/../../../templates/' . $page . '.php';
167
+        $viewFilePath = __DIR__ . '/../../../templates/' . $page . '.php';
168 168
     
169 169
         if (!empty($data)) {
170 170
             extract($data);
@@ -433,12 +433,10 @@  discard block
 block discarded – undo
433 433
         $echo = [];
434 434
 
435 435
         $echo['css'] = $this->getConfig('messengers.' . $moduleName . '.confirm_test') ? 
436
-            'success' :
437
-            '';
436
+            'success' : '';
438 437
         
439 438
         $echo['icon'] = $this->getConfig('messengers.' . $moduleName . '.confirm_test') ?
440
-            '<i class="fas fa-check"></i>' :
441
-            '<i class="fas fa-exclamation"></i>';
439
+            '<i class="fas fa-check"></i>' : '<i class="fas fa-exclamation"></i>';
442 440
 
443 441
         echo $echo[$echoType];
444 442
     }
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
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         ];
208 208
 
209 209
         if (empty($dataRange[$this->type])) {
210
-            if (preg_match('/past_([0-9]+)_days/', $this->type, $matches) ) {
210
+            if (preg_match('/past_([0-9]+)_days/', $this->type, $matches)) {
211 211
                 $dayCount = $matches[1];
212 212
                 $startDate = date('Ymd', strtotime('-' . $dayCount . ' days'));
213 213
                 $endDate = date('Ymd');
@@ -348,21 +348,21 @@  discard block
 block discarded – undo
348 348
 
349 349
         $results = [];
350 350
 
351
-        $results['captcha_chart_string']  = '';     // string
352
-        $results['pageview_chart_string'] = '';     // string
353
-        $results['captcha_success_count'] = 0;      // integer
354
-        $results['captcha_failure_count'] = 0;      // integer
355
-        $results['captcha_count'] = 0;              // integer
356
-        $results['pageview_count'] = 0;             // integer
357
-        $results['captcha_percentageage'] = 0;      // integer
351
+        $results['captcha_chart_string']  = ''; // string
352
+        $results['pageview_chart_string'] = ''; // string
353
+        $results['captcha_success_count'] = 0; // integer
354
+        $results['captcha_failure_count'] = 0; // integer
355
+        $results['captcha_count'] = 0; // integer
356
+        $results['pageview_count'] = 0; // integer
357
+        $results['captcha_percentageage'] = 0; // integer
358 358
         $results['captcha_failure_percentage'] = 0; // integer
359 359
         $results['captcha_success_percentage'] = 0; // integer
360 360
 
361
-        $results['action_ban_count'] = 0;           // integer
362
-        $results['action_temp_ban_count'] = 0;      // integer
363
-        $results['action_unban_count'] = 0;         // integer
364
-        $results['blacklist_count'] = 0;            // integer
365
-        $results['session_limit_count'] = 0;        // integer
361
+        $results['action_ban_count'] = 0; // integer
362
+        $results['action_temp_ban_count'] = 0; // integer
363
+        $results['action_unban_count'] = 0; // integer
364
+        $results['blacklist_count'] = 0; // integer
365
+        $results['session_limit_count'] = 0; // integer
366 366
 
367 367
         $ipdData = $this->getIpData();
368 368
 
@@ -405,22 +405,22 @@  discard block
 block discarded – undo
405 405
 
406 406
         $results = [];
407 407
 
408
-        $results['captcha_chart_string']  = '';     // string
409
-        $results['pageview_chart_string'] = '';     // string
410
-        $results['label_chart_string'] = '';        // string
411
-        $results['captcha_success_count'] = 0;      // integer
412
-        $results['captcha_failure_count'] = 0;      // integer
413
-        $results['captcha_count'] = 0;              // integer
414
-        $results['pageview_count'] = 0;             // integer
415
-        $results['captcha_percentageage'] = 0;      // integer
408
+        $results['captcha_chart_string']  = ''; // string
409
+        $results['pageview_chart_string'] = ''; // string
410
+        $results['label_chart_string'] = ''; // string
411
+        $results['captcha_success_count'] = 0; // integer
412
+        $results['captcha_failure_count'] = 0; // integer
413
+        $results['captcha_count'] = 0; // integer
414
+        $results['pageview_count'] = 0; // integer
415
+        $results['captcha_percentageage'] = 0; // integer
416 416
         $results['captcha_failure_percentage'] = 0; // integer
417 417
         $results['captcha_success_percentage'] = 0; // integer
418 418
 
419
-        $results['action_ban_count'] = 0;           // integer
420
-        $results['action_temp_ban_count'] = 0;      // integer
421
-        $results['action_unban_count'] = 0;         // integer
422
-        $results['blacklist_count'] = 0;            // integer
423
-        $results['session_limit_count'] = 0;        // integer
419
+        $results['action_ban_count'] = 0; // integer
420
+        $results['action_temp_ban_count'] = 0; // integer
421
+        $results['action_unban_count'] = 0; // integer
422
+        $results['blacklist_count'] = 0; // integer
423
+        $results['session_limit_count'] = 0; // integer
424 424
 
425 425
         if (!empty($periodData)) {
426 426
 
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
             }
451 451
 
452 452
             $results['captcha_chart_string'] = implode(',', $chartCaptcha);
453
-            $results['pageview_chart_string']= implode(',', $chartPageview);
453
+            $results['pageview_chart_string'] = implode(',', $chartPageview);
454 454
             $results['captcha_success_chart_string'] = implode(',', $chartCaptchaSuccess);
455 455
             $results['captcha_failure_chart_string'] = implode(',', $chartCaptchaFailure);
456 456
             $results['label_chart_string'] = "'" . implode("','", $labels) . "'";
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
         $ip = $log['ip'];
481 481
         $sessionId = $log['session_id'];
482 482
 
483
-        $this->ipDetail[$t][$ip]['session_id'][$sessionId ] = 1;
483
+        $this->ipDetail[$t][$ip]['session_id'][$sessionId] = 1;
484 484
 
485 485
         if ($logActionCode === self::LOG_TEMPORARILY_BAN) {
486 486
             $this->periodDetail[$t][$k]['action_temp_ban_count']++;
Please login to merge, or discard this patch.
src/Firewall/Firewall/SetupTrait.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
         foreach ($ipList as $ip) {
281 281
 
282
-            if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url']) ) {
282
+            if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url'])) {
283 283
 
284 284
                 if ('allow' === $ip['rule']) {
285 285
                     $allowedList[] = $ip['ip'];
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
         $this->kernel->setProperty(
353 353
             'deny_attempt_enable',
354 354
             [
355
-                'data_circle'     => $setting['data_circle']['enable'],     // false   
355
+                'data_circle'     => $setting['data_circle']['enable'], // false   
356 356
                 'system_firewall' => $setting['system_firewall']['enable'], // false   
357 357
             ]
358 358
         );
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
         $this->kernel->setProperty(
361 361
             'deny_attempt_buffer',
362 362
             [
363
-                'data_circle'     => $setting['data_circle']['buffer'],     // 10
363
+                'data_circle'     => $setting['data_circle']['buffer'], // 10
364 364
                 'system_firewall' => $setting['system_firewall']['buffer'], // 10
365 365
             ]
366 366
         );
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 
429 429
             $lastResetTime = $cronjobSetting['config']['last_update'];
430 430
 
431
-            if (!empty($lastResetTime) ) {
431
+            if (!empty($lastResetTime)) {
432 432
                 $lastResetTime = strtotime($lastResetTime);
433 433
             } else {
434 434
                 // @codeCoverageIgnoreStart
Please login to merge, or discard this patch.
templates/panel/iptables_manager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
                     <select name="subnet" class="regular" id="subnet">
60 60
                         <option value="null">---</option>
61 61
                         <?php for ($i = 32; $i > 0; $i--) : ?>
62
-                            <?php $label = $i;  ?>
62
+                            <?php $label = $i; ?>
63 63
                             <?php if ($i === 8) $label = $i . ' (A)'; ?>
64 64
                             <?php if ($i === 16) $label = $i . ' (B)'; ?>
65 65
                             <?php if ($i === 24) $label = $i . ' (C)'; ?>
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                     <select name="subnet" class="regular" id="subnet">
72 72
                         <option value="null">---</option>
73 73
                         <?php for ($i = 128; $i > 0; $i--) : ?>
74
-                            <?php $label = $i;  ?>
74
+                            <?php $label = $i; ?>
75 75
                             <option value="<?php echo $i; ?>"><?php echo $label; ?></option>
76 76
                         <?php endfor; ?>
77 77
                     </select>
Please login to merge, or discard this patch.
templates/panel/xss_protection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@
 block discarded – undo
128 128
         </div>
129 129
     </div>
130 130
     <br />
131
-    <?php if ( empty($xss_protected_list)) : ?>
131
+    <?php if (empty($xss_protected_list)) : ?>
132 132
     <div id="so-table-container" class="so-datatables">
133 133
         <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%">
134 134
             <tbody>
Please login to merge, or discard this patch.
templates/panel/ip_manager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
         </div>
72 72
     </div>
73 73
     <br />
74
-    <?php if ( empty($ip_list)) : ?>
74
+    <?php if (empty($ip_list)) : ?>
75 75
     <div id="so-table-container" class="so-datatables">
76 76
         <table id="so-datalog" class="cell-border compact stripe responsive" cellspacing="0" width="100%">
77 77
             <tbody>
Please login to merge, or discard this patch.
src/Firewall/Panel/Report.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -197,11 +197,11 @@
 block discarded – undo
197 197
     private function operationTemplateVarsOfComponents(array $data = []): array
198 198
     {
199 199
         $data['components'] = [
200
-            'Ip'         => (!empty($this->kernel->component['Ip']))         ? true : false,
200
+            'Ip'         => (!empty($this->kernel->component['Ip'])) ? true : false,
201 201
             'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false,
202
-            'Header'     => (!empty($this->kernel->component['Header']))     ? true : false,
203
-            'Rdns'       => (!empty($this->kernel->component['Rdns']))       ? true : false,
204
-            'UserAgent'  => (!empty($this->kernel->component['UserAgent']))  ? true : false,
202
+            'Header'     => (!empty($this->kernel->component['Header'])) ? true : false,
203
+            'Rdns'       => (!empty($this->kernel->component['Rdns'])) ? true : false,
204
+            'UserAgent'  => (!empty($this->kernel->component['UserAgent'])) ? true : false,
205 205
         ];
206 206
 
207 207
         return $data;
Please login to merge, or discard this patch.