Passed
Push — 2.x ( 596a61...b45439 )
by Terry
01:46
created
src/Firewall/Log/ActionLogParser.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
         ];
198 198
 
199 199
         if (empty($dataRange[$this->type])) {
200
-            if (preg_match('/past_([0-9]+)_days/', $this->type, $matches) ) {
200
+            if (preg_match('/past_([0-9]+)_days/', $this->type, $matches)) {
201 201
                 $dayCount = $matches[1];
202 202
                 $startDate = date('Ymd', strtotime('-' . $dayCount . ' days'));
203 203
                 $endDate = date('Ymd');
@@ -336,21 +336,21 @@  discard block
 block discarded – undo
336 336
             return [];
337 337
         }
338 338
 
339
-        $results['captcha_chart_string']  = '';     // string
340
-        $results['pageview_chart_string'] = '';     // string
341
-        $results['captcha_success_count'] = 0;      // integer
342
-        $results['captcha_failure_count'] = 0;      // integer
343
-        $results['captcha_count'] = 0;              // integer
344
-        $results['pageview_count'] = 0;             // integer
345
-        $results['captcha_percentageage'] = 0;      // integer
339
+        $results['captcha_chart_string']  = ''; // string
340
+        $results['pageview_chart_string'] = ''; // string
341
+        $results['captcha_success_count'] = 0; // integer
342
+        $results['captcha_failure_count'] = 0; // integer
343
+        $results['captcha_count'] = 0; // integer
344
+        $results['pageview_count'] = 0; // integer
345
+        $results['captcha_percentageage'] = 0; // integer
346 346
         $results['captcha_failure_percentage'] = 0; // integer
347 347
         $results['captcha_success_percentage'] = 0; // integer
348 348
 
349
-        $results['action_ban_count'] = 0;           // integer
350
-        $results['action_temp_ban_count'] = 0;      // integer
351
-        $results['action_unban_count'] = 0;         // integer
352
-        $results['blacklist_count'] = 0;            // integer
353
-        $results['session_limit_count'] = 0;        // integer
349
+        $results['action_ban_count'] = 0; // integer
350
+        $results['action_temp_ban_count'] = 0; // integer
351
+        $results['action_unban_count'] = 0; // integer
352
+        $results['blacklist_count'] = 0; // integer
353
+        $results['session_limit_count'] = 0; // integer
354 354
 
355 355
         $ipdData = $this->getIpData();
356 356
 
@@ -391,22 +391,22 @@  discard block
 block discarded – undo
391 391
     {
392 392
         $periodData = $this->getPeriodData();
393 393
 
394
-        $results['captcha_chart_string']  = '';     // string
395
-        $results['pageview_chart_string'] = '';     // string
396
-        $results['label_chart_string'] = '';        // string
397
-        $results['captcha_success_count'] = 0;      // integer
398
-        $results['captcha_failure_count'] = 0;      // integer
399
-        $results['captcha_count'] = 0;              // integer
400
-        $results['pageview_count'] = 0;             // integer
401
-        $results['captcha_percentageage'] = 0;      // integer
394
+        $results['captcha_chart_string']  = ''; // string
395
+        $results['pageview_chart_string'] = ''; // string
396
+        $results['label_chart_string'] = ''; // string
397
+        $results['captcha_success_count'] = 0; // integer
398
+        $results['captcha_failure_count'] = 0; // integer
399
+        $results['captcha_count'] = 0; // integer
400
+        $results['pageview_count'] = 0; // integer
401
+        $results['captcha_percentageage'] = 0; // integer
402 402
         $results['captcha_failure_percentage'] = 0; // integer
403 403
         $results['captcha_success_percentage'] = 0; // integer
404 404
 
405
-        $results['action_ban_count'] = 0;           // integer
406
-        $results['action_temp_ban_count'] = 0;      // integer
407
-        $results['action_unban_count'] = 0;         // integer
408
-        $results['blacklist_count'] = 0;            // integer
409
-        $results['session_limit_count'] = 0;        // integer
405
+        $results['action_ban_count'] = 0; // integer
406
+        $results['action_temp_ban_count'] = 0; // integer
407
+        $results['action_unban_count'] = 0; // integer
408
+        $results['blacklist_count'] = 0; // integer
409
+        $results['session_limit_count'] = 0; // integer
410 410
 
411 411
         if (!empty($periodData)) {
412 412
 
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             }
437 437
 
438 438
             $results['captcha_chart_string'] = implode(',', $chartCaptcha);
439
-            $results['pageview_chart_string']= implode(',', $chartPageview);
439
+            $results['pageview_chart_string'] = implode(',', $chartPageview);
440 440
             $results['captcha_success_chart_string'] = implode(',', $chartCaptchaSuccess);
441 441
             $results['captcha_failure_chart_string'] = implode(',', $chartCaptchaFailure);
442 442
             $results['label_chart_string'] = "'" . implode("','", $labels) . "'";
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
         $ip = $log['ip'];
467 467
         $sessionId = $log['session_id'];
468 468
 
469
-        $this->ipDetail[$t][$ip]['session_id'][$sessionId ] = 1;
469
+        $this->ipDetail[$t][$ip]['session_id'][$sessionId] = 1;
470 470
 
471 471
         if ($logActionCode === self::LOG_TEMPORARILY_BAN) {
472 472
             $this->periodDetail[$t][$k]['action_temp_ban_count']++;
Please login to merge, or discard this patch.
src/Firewall/Kernel.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -614,9 +614,9 @@
 block discarded – undo
614 614
         $this->initComponents();
615 615
 
616 616
         $processMethods = [
617
-            'isRuleExist',   // Stage 1 - Looking for rule table.
618
-            'isTrustedBot',  // Stage 2 - Detect popular search engine.
619
-            'isFakeRobot',   // Stage 3 - Reject fake search engine crawlers.
617
+            'isRuleExist', // Stage 1 - Looking for rule table.
618
+            'isTrustedBot', // Stage 2 - Detect popular search engine.
619
+            'isFakeRobot', // Stage 3 - Reject fake search engine crawlers.
620 620
             'isIpComponent', // Stage 4 - IP manager.
621 621
             'isComponents'   // Stage 5 - Check other components.
622 622
         ];
Please login to merge, or discard this patch.
src/Firewall/Panel/BaseController.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             define('SHIELDON_VIEW', true);
170 170
         }
171 171
 
172
-        $viewFilePath =  __DIR__ . '/../../../templates/' . $page . '.php';
172
+        $viewFilePath = __DIR__ . '/../../../templates/' . $page . '.php';
173 173
     
174 174
         if (!empty($data)) {
175 175
             extract($data);
@@ -451,12 +451,10 @@  discard block
 block discarded – undo
451 451
     protected function messengerAjaxStatus(string $moduleName, string $echoType = 'css'): void
452 452
     {
453 453
         $echo['css'] = $this->getConfig('messengers.' . $moduleName . '.confirm_test') ? 
454
-            'success' :
455
-            '';
454
+            'success' : '';
456 455
         
457 456
         $echo['icon'] = $this->getConfig('messengers.' . $moduleName . '.confirm_test') ?
458
-            '<i class="fas fa-check"></i>' :
459
-            '<i class="fas fa-exclamation"></i>';
457
+            '<i class="fas fa-check"></i>' : '<i class="fas fa-exclamation"></i>';
460 458
 
461 459
         echo $echo[$echoType];
462 460
     }
Please login to merge, or discard this patch.
src/Firewall/Firewall/Captcha/CaptchaFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $str = implode(
80 80
             '',
81 81
             array_map(
82
-                function ($word) {
82
+                function($word) {
83 83
                     return ucwords($word); 
84 84
                 },
85 85
                 $str
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
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
             $this->kernel->setClosure(
81 81
                 'xss_post',
82
-                function () use ($xss) {
82
+                function() use ($xss) {
83 83
                     if (!empty($_POST)) {
84 84
                         foreach (array_keys($_POST) as $k) {
85 85
                             $_POST[$k] = $xss->clean($_POST[$k]);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 
105 105
             $this->kernel->setClosure(
106 106
                 'xss_get',
107
-                function () use ($xss) {
107
+                function() use ($xss) {
108 108
                     if (!empty($_GET)) {
109 109
                         foreach (array_keys($_GET) as $k) {
110 110
                             $_GET[$k] = $xss->clean($_GET[$k]);
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
             $this->kernel->setClosure(
131 131
                 'xss_cookie',
132
-                function () use ($xss) {
132
+                function() use ($xss) {
133 133
                     if (!empty($_COOKIE)) {
134 134
                         foreach (array_keys($_COOKIE) as $k) {
135 135
                             $_COOKIE[$k] = $xss->clean($_COOKIE[$k]);
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
 
155 155
             $this->kernel->setClosure(
156 156
                 'xss_protection', 
157
-                function () use ($xss, $protectedList) {
157
+                function() use ($xss, $protectedList) {
158 158
                     foreach ($protectedList as $v) {
159 159
                         $k = $v['variable'] ?? 'undefined';
160 160
         
Please login to merge, or discard this patch.
templates/frontend/login.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                 <div class="card-body">
130 130
                     <form action="<?php echo $form ?>" method="post" autocomplete="off">
131 131
                         <div class="main-content">
132
-                            <?php if (! empty($error)) : ?>
132
+                            <?php if (!empty($error)) : ?>
133 133
                             <div class="error-notice">
134 134
                                 <?php echo $error; ?>
135 135
                             </div>
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                             <div class="input-box">
141 141
                                 <input type="password" name="s_pass" placeholder="Password" class="form-input" />
142 142
                             </div>
143
-                            <?php if (! empty($captchas)) : ?>
143
+                            <?php if (!empty($captchas)) : ?>
144 144
                             <div class="input-box">
145 145
                                 <?php foreach ($captchas as $captcha) : ?>
146 146
                                     <?php echo $captcha->form(); ?>
Please login to merge, or discard this patch.
templates/frontend/captcha.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
                             <p><input type="submit" value="<?php _e('core', 'stop_submit', 'Submit') ?>" /></p>
61 61
                         </form>
62 62
                     </div>
63
-                    <?php if (! empty($dialoguserinfo)) : ?>
63
+                    <?php if (!empty($dialoguserinfo)) : ?>
64 64
                         <div class="status-user-info">
65 65
                             <?php foreach ($dialoguserinfo as $key => $userinfo) : ?>
66 66
                                 <div class="row">
Please login to merge, or discard this patch.
src/Firewall/Firewall/MainTrait.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.
src/Firewall/Firewall/Messenger/MessengerFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $str = implode(
80 80
             '',
81 81
             array_map(
82
-                function ($word) {
82
+                function($word) {
83 83
                     return ucwords($word); 
84 84
                 },
85 85
                 $str
Please login to merge, or discard this patch.