Passed
Push — 2.x ( 315570...b7427f )
by Terry
09:36 queued 59s
created
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   +26 added lines, -26 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');
@@ -350,18 +350,18 @@  discard block
 block discarded – undo
350 350
 
351 351
         $results['captcha_chart_string']       = ''; // string
352 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
-        $results['captcha_failure_percentage'] = 0;  // integer
359
-        $results['captcha_success_percentage'] = 0;  // integer
360
-        $results['action_ban_count']           = 0;  // integer
361
-        $results['action_temp_ban_count']      = 0;  // integer
362
-        $results['action_unban_count']         = 0;  // integer
363
-        $results['blacklist_count']            = 0;  // integer
364
-        $results['session_limit_count']        = 0;  // integer
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
+        $results['captcha_failure_percentage'] = 0; // integer
359
+        $results['captcha_success_percentage'] = 0; // integer
360
+        $results['action_ban_count']           = 0; // integer
361
+        $results['action_temp_ban_count']      = 0; // integer
362
+        $results['action_unban_count']         = 0; // integer
363
+        $results['blacklist_count']            = 0; // integer
364
+        $results['session_limit_count']        = 0; // integer
365 365
 
366 366
         $ipdData = $this->getIpData();
367 367
 
@@ -406,18 +406,18 @@  discard block
 block discarded – undo
406 406
         $results['label_chart_string']         = ''; // string
407 407
         $results['captcha_chart_string']       = ''; // string
408 408
         $results['pageview_chart_string']      = ''; // string
409
-        $results['captcha_success_count']      = 0;  // integer
410
-        $results['captcha_failure_count']      = 0;  // integer
411
-        $results['captcha_count']              = 0;  // integer
412
-        $results['pageview_count']             = 0;  // integer
413
-        $results['captcha_percentageage']      = 0;  // integer
414
-        $results['captcha_failure_percentage'] = 0;  // integer
415
-        $results['captcha_success_percentage'] = 0;  // integer
416
-        $results['action_ban_count']           = 0;  // integer
417
-        $results['action_temp_ban_count']      = 0;  // integer
418
-        $results['action_unban_count']         = 0;  // integer
419
-        $results['blacklist_count']            = 0;  // integer
420
-        $results['session_limit_count']        = 0;  // integer
409
+        $results['captcha_success_count']      = 0; // integer
410
+        $results['captcha_failure_count']      = 0; // integer
411
+        $results['captcha_count']              = 0; // integer
412
+        $results['pageview_count']             = 0; // integer
413
+        $results['captcha_percentageage']      = 0; // integer
414
+        $results['captcha_failure_percentage'] = 0; // integer
415
+        $results['captcha_success_percentage'] = 0; // integer
416
+        $results['action_ban_count']           = 0; // integer
417
+        $results['action_temp_ban_count']      = 0; // integer
418
+        $results['action_unban_count']         = 0; // integer
419
+        $results['blacklist_count']            = 0; // integer
420
+        $results['session_limit_count']        = 0; // integer
421 421
 
422 422
         if (!empty($periodData)) {
423 423
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
         $ip = $log['ip'];
478 478
         $sessionId = $log['session_id'];
479 479
 
480
-        $this->ipDetail[$t][$ip]['session_id'][$sessionId ] = 1;
480
+        $this->ipDetail[$t][$ip]['session_id'][$sessionId] = 1;
481 481
 
482 482
         if ($logActionCode === self::LOG_TEMPORARILY_BAN) {
483 483
             $this->periodDetail[$t][$k]['action_temp_ban_count']++;
Please login to merge, or discard this patch.
src/Firewall/Panel/Report.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             $data = array_merge($data, $result);
138 138
         }
139 139
 
140
-        $data['page_availability'] = $this->pageAvailability['logs'];;
140
+        $data['page_availability'] = $this->pageAvailability['logs']; ;
141 141
 
142 142
         $data['page_url'] = $this->url('report/actionLog');
143 143
 
@@ -209,11 +209,11 @@  discard block
 block discarded – undo
209 209
     private function operationTemplateVarsOfComponents(array $data = []): array
210 210
     {
211 211
         $data['components'] = [
212
-            'Ip'         => (!empty($this->kernel->component['Ip']))         ? true : false,
212
+            'Ip'         => (!empty($this->kernel->component['Ip'])) ? true : false,
213 213
             'TrustedBot' => (!empty($this->kernel->component['TrustedBot'])) ? true : false,
214
-            'Header'     => (!empty($this->kernel->component['Header']))     ? true : false,
215
-            'Rdns'       => (!empty($this->kernel->component['Rdns']))       ? true : false,
216
-            'UserAgent'  => (!empty($this->kernel->component['UserAgent']))  ? true : false,
214
+            'Header'     => (!empty($this->kernel->component['Header'])) ? true : false,
215
+            'Rdns'       => (!empty($this->kernel->component['Rdns'])) ? true : false,
216
+            'UserAgent'  => (!empty($this->kernel->component['UserAgent'])) ? true : false,
217 217
         ];
218 218
 
219 219
         return $data;
Please login to merge, or discard this patch.
src/Firewall/Session.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@
 block discarded – undo
175 175
      * @return void
176 176
      */
177 177
     public function init(
178
-             $driver, 
178
+                $driver, 
179 179
         int  $gcExpires     = 300, 
180 180
         int  $gcProbability = 1, 
181 181
         int  $gcDivisor     = 100, 
Please login to merge, or discard this patch.
src/Firewall/Kernel/TemplateTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -321,8 +321,8 @@
 block discarded – undo
321 321
         $statStart = Container::get('shieldon_start');
322 322
         $statEnd = Container::get('shieldon_end');
323 323
 
324
-        $startTimeArr = explode(' ',$statStart['time']);
325
-        $endTimeArr = explode(' ',$statStart['time']);
324
+        $startTimeArr = explode(' ', $statStart['time']);
325
+        $endTimeArr = explode(' ', $statStart['time']);
326 326
 
327 327
         $timeDifference = ($endTimeArr[1] - $startTimeArr[1]) + ($endTimeArr[0] - $startTimeArr[0]);
328 328
         $memoryDifference = round(($statEnd['memory'] - $statStart['memory']) / 1024, 2); // KB
Please login to merge, or discard this patch.
src/Firewall/Kernel/DriverTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@
 block discarded – undo
105 105
             $this->driver->setChannel($channel);
106 106
         } else {
107 107
             Event::AddListener('set_driver',
108
-                function ($args) use ($channel) {
108
+                function($args) use ($channel) {
109 109
                     $args['driver']->setChannel($channel);
110 110
                 }
111 111
             );
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
@@ -111,10 +111,10 @@
 block discarded – undo
111 111
 
112 112
         $data = [];
113 113
 
114
-        $data[0] = $record['ip']          ?? 'null';
115
-        $data[1] = $record['session_id']  ?? 'null';
114
+        $data[0] = $record['ip'] ?? 'null';
115
+        $data[1] = $record['session_id'] ?? 'null';
116 116
         $data[2] = $record['action_code'] ?? 'null';
117
-        $data[3] = $record['timestamp']    ?? 'null';
117
+        $data[3] = $record['timestamp'] ?? 'null';
118 118
 
119 119
         file_put_contents($this->filePath, implode(',', $data) . "\n", FILE_APPEND | LOCK_EX);
120 120
     }
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.