Passed
Push — 2.x ( 0e59db...327f41 )
by Terry
02:06
created
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
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
     {
244 244
         $driverType = (string) $this->getOption('driver_type');
245 245
 
246
-        return $this->directory . '/' . $this->channel .  '_' . $driverType . '_' . $this->checkpoint;
246
+        return $this->directory . '/' . $this->channel . '_' . $driverType . '_' . $this->checkpoint;
247 247
     }
248 248
 
249 249
     /**
Please login to merge, or discard this patch.
src/Firewall/Helpers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,7 @@
 block discarded – undo
213 213
         $masked = implode('.', $tmp);
214 214
 
215 215
     } else {
216
-        $masked =  str_repeat('*', strlen($str) - 6) . substr($str, -6);
216
+        $masked = str_repeat('*', strlen($str) - 6) . substr($str, -6);
217 217
     }
218 218
 
219 219
     return $masked;
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
@@ -112,10 +112,10 @@
 block discarded – undo
112 112
 
113 113
         $data = [];
114 114
 
115
-        $data[0] = $record['ip']          ?? 'null';
116
-        $data[1] = $record['session_id']  ?? 'null';
115
+        $data[0] = $record['ip'] ?? 'null';
116
+        $data[1] = $record['session_id'] ?? 'null';
117 117
         $data[2] = $record['action_code'] ?? 'null';
118
-        $data[3] = $record['timesamp']    ?? 'null';
118
+        $data[3] = $record['timesamp'] ?? 'null';
119 119
 
120 120
         file_put_contents($this->filePath, implode(',', $data) . "\n", FILE_APPEND | LOCK_EX);
121 121
     }
Please login to merge, or discard this patch.
src/Firewall/Firewall/Captcha/ItemImage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public static function get(array $setting): CaptchaInterface
41 41
     {
42
-        $type   = $setting['config']['type']   ?? 'alnum';
42
+        $type   = $setting['config']['type'] ?? 'alnum';
43 43
         $length = $setting['config']['length'] ?? 8;
44 44
 
45 45
         $imageCaptchaConfig = [];
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
@@ -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.
templates/panel/template.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@
 block discarded – undo
246 246
                 </div>
247 247
             </div>
248 248
         </div>
249
-        <?php if (! empty($this->messages)) : ?>
249
+        <?php if (!empty($this->messages)) : ?>
250 250
         <div id="message-modal" class="modal fade" tabindex="-1" role="dialog">
251 251
             <div class="modal-dialog modal-dialog-centered modal-lightbox" role="document">
252 252
                 <div class="modal-content">
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -263,13 +263,16 @@
 block discarded – undo
263 263
                                         <?php endif; ?>
264 264
                                      </span>
265 265
                                 </div>
266
-                            <?php else: ?>
266
+                            <?php else {
267
+    : ?>
267 268
                                 <div class="icon-box">
268 269
                                     <span class="message-icon">
269 270
                                         <i class="fas fa-exclamation-circle"></i>
270 271
                                     </span>
271 272
                                 </div>
272
-                            <?php endif; ?>
273
+                            <?php endif;
274
+}
275
+?>
273 276
                         </div>
274 277
                         <button type="button" class="close" data-dismiss="modal" aria-label="Close">
275 278
                             <span aria-hidden="true">&times;</span>
Please login to merge, or discard this patch.