Passed
Push — 2.x ( a6612a...ac5abc )
by Terry
02:22
created
src/Firewall/Driver/FileDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -356,8 +356,8 @@
 block discarded – undo
356 356
         $path = [];
357 357
 
358 358
         $path['filter'] = $this->directory . '/' . $this->tableFilterLogs . '/' . $ip . '.' . $this->extension;
359
-        $path['session'] = $this->directory . '/' . $this->tableSessions   . '/' . $ip . '.' . $this->extension;
360
-        $path['rule'] = $this->directory . '/' . $this->tableRuleList   . '/' . $ip . '.' . $this->extension;
359
+        $path['session'] = $this->directory . '/' . $this->tableSessions . '/' . $ip . '.' . $this->extension;
360
+        $path['rule'] = $this->directory . '/' . $this->tableRuleList . '/' . $ip . '.' . $this->extension;
361 361
 
362 362
         return $path[$type] ?? '';
363 363
     }
Please login to merge, or discard this patch.
src/Firewall/Log/ActionLogger.php 2 patches
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.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -224,13 +224,13 @@
 block discarded – undo
224 224
     }
225 225
 
226 226
 /**
227
-     * Get data from log file.
228
-     *
229
-     * @param string $fromYmd The string in Ymd Date format.
230
-     * @param string $toYmd   The end date.
231
-     *
232
-     * @return array
233
-     */
227
+ * Get data from log file.
228
+ *
229
+ * @param string $fromYmd The string in Ymd Date format.
230
+ * @param string $toYmd   The end date.
231
+ *
232
+ * @return array
233
+ */
234 234
     private function getDataFromSingleDate(string $fromYmd = '', string $toYmd = ''): array
235 235
     {
236 236
         $results = [];
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/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/frontend/captcha.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
 							<p><input type="submit" value="<?php _e('core', 'stop_submit', 'Submit') ?>" /></p>
51 51
 						</form>
52 52
 					</div>
53
-					<?php if (! empty($dialoguserinfo)) : ?>
53
+					<?php if (!empty($dialoguserinfo)) : ?>
54 54
 						<div class="status-user-info">
55 55
 							<?php foreach ($dialoguserinfo as $key => $userinfo) : ?>
56 56
 								<div class="row">
Please login to merge, or discard this patch.
src/Firewall/Panel/BaseController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@
 block discarded – undo
165 165
             define('SHIELDON_VIEW', true);
166 166
         }
167 167
 
168
-        $viewFilePath =  __DIR__ . '/../../../templates/' . $page . '.php';
168
+        $viewFilePath = __DIR__ . '/../../../templates/' . $page . '.php';
169 169
     
170 170
         if (!empty($data)) {
171 171
             extract($data);
Please login to merge, or discard this patch.
src/Firewall/Panel/ConfigMethodsTrait.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,14 +35,14 @@
 block discarded – undo
35 35
  */
36 36
 trait ConfigMethodsTrait
37 37
 {
38
-     /**
39
-     * Parse the POST fields and set them into configuration data structure.
40
-     * Used for saveConfig method only.
41
-     *
42
-     * @param array $postParams
43
-     *
44
-     * @return void
45
-     */
38
+        /**
39
+         * Parse the POST fields and set them into configuration data structure.
40
+         * Used for saveConfig method only.
41
+         *
42
+         * @param array $postParams
43
+         *
44
+         * @return void
45
+         */
46 46
     protected function saveConfigPrepareSettings(array $postParams): void
47 47
     {
48 48
         foreach ($postParams as $postKey => $postData) {
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                 } elseif (is_numeric($postData)) {
80 80
                     $this->setConfig(str_replace('__', '.', $postKey), (int) $postData);
81 81
 
82
-                } else  {
82
+                } else {
83 83
                     $this->setConfig(str_replace('__', '.', $postKey), $postData);
84 84
                 }
85 85
             }
@@ -162,10 +162,10 @@  discard block
 block discarded – undo
162 162
             // Create default log files.
163 163
             if (is_writable($iptablesWatchingFolder)) {
164 164
                 fopen($iptablesWatchingFolder . '/iptables_queue.log', 'w+');
165
-                fopen($iptablesWatchingFolder . '/ipv4_status.log',    'w+');
166
-                fopen($iptablesWatchingFolder . '/ipv6_status.log',    'w+');
167
-                fopen($iptablesWatchingFolder . '/ipv4_command.log',   'w+');
168
-                fopen($iptablesWatchingFolder . '/ipv6_command.log',   'w+');
165
+                fopen($iptablesWatchingFolder . '/ipv4_status.log', 'w+');
166
+                fopen($iptablesWatchingFolder . '/ipv6_status.log', 'w+');
167
+                fopen($iptablesWatchingFolder . '/ipv4_command.log', 'w+');
168
+                fopen($iptablesWatchingFolder . '/ipv6_command.log', 'w+');
169 169
 
170 170
                 return $result;
171 171
             }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
                     (string) $db['user'],
238 238
                     (string) $db['pass']
239 239
                 );
240
-            } catch(PDOException $e) {
240
+            } catch (PDOException $e) {
241 241
 
242 242
                 $result = false;
243 243
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             try {
297 297
                 new PDO('sqlite:' . $sqliteFilePath);
298 298
 
299
-            } catch(PDOException $e) { 
299
+            } catch (PDOException $e) { 
300 300
                 $this->pushMessage('error', $e->getMessage());
301 301
                 $result = false;
302 302
             }
@@ -343,11 +343,11 @@  discard block
 block discarded – undo
343 343
                 $redis = new Redis();
344 344
                 $redis->connect(
345 345
                     (string) $this->getConfig('drivers.redis.host'), 
346
-                    (int)    $this->getConfig('drivers.redis.port')
346
+                    (int) $this->getConfig('drivers.redis.port')
347 347
                 );
348 348
                 unset($redis);
349 349
 
350
-            } catch(RedisException $e) {
350
+            } catch (RedisException $e) {
351 351
                 $this->pushMessage('error', $e->getMessage());
352 352
                 $result = false;
353 353
             }
Please login to merge, or discard this patch.
src/Firewall/Firewall/Driver/ItemSqliteDriver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
         // @codeCoverageIgnoreStart
46 46
 
47
-        } catch(PDOException $e) {
47
+        } catch (PDOException $e) {
48 48
             echo $e->getMessage();
49 49
         }
50 50
 
Please login to merge, or discard this patch.
src/Firewall/Firewall/Driver/ItemRedisDriver.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
 
61 61
         // @codeCoverageIgnoreStart
62 62
 
63
-        } catch(RedisException $e) {
63
+        } catch (RedisException $e) {
64 64
             echo $e->getMessage();
65 65
         }
66 66
 
Please login to merge, or discard this patch.