Passed
Push — 2.x ( 077994...b17bf1 )
by Terry
01:51
created
templates/panel/overview.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
                 <div class="filter-status">
204 204
                     <div class="heading"><?php _e('panel', 'overview_label_action_logger', 'Action Logger'); ?></div>
205 205
                     <div class="nums">
206
-                        <?php echo $data['action_logger']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
206
+                        <?php echo $data['action_logger'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
207 207
                     </div>
208 208
                     <div class="note"><?php _e('panel', 'overview_note_action_logger', 'Record every visitor’s behavior.'); ?></div>
209 209
                 </div>
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 <div class="filter-status">
223 223
                     <div class="heading"><?php _e('panel', 'overview_label_recaptcha', 'reCAPTCHA'); ?></div>
224 224
                     <div class="nums">
225
-                        <?php echo $captcha['recaptcha']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
225
+                        <?php echo $captcha['recaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
226 226
                     </div>
227 227
                     <div class="note"><?php _e('panel', 'overview_note_recaptcha', 'Provided by Google.'); ?></div>
228 228
                 </div>
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 <div class="filter-status">
232 232
                     <div class="heading"><?php _e('panel', 'overview_label_image_captcha', 'Image Captcha'); ?></div>
233 233
                     <div class="nums">
234
-                        <?php echo $captcha['imagecaptcha']  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
234
+                        <?php echo $captcha['imagecaptcha'] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
235 235
                     </div>
236 236
                     <div class="note"><?php _e('panel', 'overview_note_image_captcha', 'A simple text-in-image Captcha.'); ?></div>
237 237
                 </div>
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                 <div class="filter-status">
252 252
                     <div class="heading"><?php _e('panel', 'overview_label_' . $k, ''); ?></div>
253 253
                     <div class="nums">
254
-                        <?php echo $messengers[$k]  ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
254
+                        <?php echo $messengers[$k] ? '<i class="far fa-play-circle"></i>' : '<i class="far fa-stop-circle"></i>'; ?>
255 255
                     </div>
256 256
                     <div class="note"><?php _e('panel', 'overview_note_' . $k, ''); ?></div>
257 257
                 </div>
Please login to merge, or discard this patch.
src/Firewall/Kernel.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
      * 
341 341
      * @return void
342 342
      */
343
-    public function __construct(?ServerRequestInterface $request  = null, ?ResponseInterface $response = null)
343
+    public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null)
344 344
     {
345 345
         // Load helper functions. This is the must.
346 346
         new Helpers();
@@ -1648,10 +1648,10 @@  discard block
 block discarded – undo
1648 1648
 
1649 1649
         $ui = [
1650 1650
             'background_image' => $this->dialogUI['background_image'] ?? '',
1651
-            'bg_color'         => $this->dialogUI['bg_color']         ?? '#ffffff',
1652
-            'header_bg_color'  => $this->dialogUI['header_bg_color']  ?? '#212531',
1653
-            'header_color'     => $this->dialogUI['header_color']     ?? '#ffffff',
1654
-            'shadow_opacity'   => $this->dialogUI['shadow_opacity']   ?? '0.2',
1651
+            'bg_color'         => $this->dialogUI['bg_color'] ?? '#ffffff',
1652
+            'header_bg_color'  => $this->dialogUI['header_bg_color'] ?? '#212531',
1653
+            'header_color'     => $this->dialogUI['header_color'] ?? '#ffffff',
1654
+            'shadow_opacity'   => $this->dialogUI['shadow_opacity'] ?? '0.2',
1655 1655
         ];
1656 1656
 
1657 1657
         if (!defined('SHIELDON_VIEW')) {
Please login to merge, or discard this patch.
src/Firewall/Panel/Ajax.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      *
49 49
      * @return bool
50 50
      */
51
-    public function  __call($function , $args)
51
+    public function  __call($function, $args)
52 52
     {
53 53
         $className = 'Shieldon\Firewall\Panel\Sandbox\\' . $function;
54 54
 
Please login to merge, or discard this patch.
src/Firewall/Driver/FileDriver.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
111 111
             $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
112 112
 
113
-            foreach($files as $file) {
113
+            foreach ($files as $file) {
114 114
                 if ($file->isFile()) {
115 115
 
116 116
                     $content = json_decode(file_get_contents($file->getPath() . '/' . $file->getFilename()), true);
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
                 $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
240 240
                 $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
241 241
     
242
-                foreach($files as $file) {
242
+                foreach ($files as $file) {
243 243
                     if ($file->isDir()) {
244 244
                         // @codeCoverageIgnoreStart
245 245
                         rmdir($file->getRealPath());
@@ -356,8 +356,8 @@  discard block
 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/Driver/SqlDriverProvider.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@
 block discarded – undo
149 149
         return $results;
150 150
     }
151 151
 
152
-   /**
152
+    /**
153 153
      * {@inheritDoc}
154 154
      */
155 155
     protected function doFetchAll(string $type = 'filter'): array
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
     protected function doDelete(string $ip, string $type = 'filter'): bool
281 281
     {
282 282
         switch ($type) {
283
-            case 'rule'      : return $this->remove($this->tableRuleList,   ['log_ip' => $ip]);
283
+            case 'rule'      : return $this->remove($this->tableRuleList, ['log_ip' => $ip]);
284 284
             case 'filter': return $this->remove($this->tableFilterLogs, ['log_ip' => $ip]);
285
-            case 'session'   : return $this->remove($this->tableSessions,   ['id'     => $ip]);
285
+            case 'session'   : return $this->remove($this->tableSessions, ['id'     => $ip]);
286 286
         }
287 287
 
288 288
         return false;
@@ -308,14 +308,14 @@  discard block
 block discarded – undo
308 308
     private function update(string $table, array $data, array $where)
309 309
     {
310 310
         $placeholder = [];
311
-        foreach($data as $k => $v) {
311
+        foreach ($data as $k => $v) {
312 312
             $placeholder[] = "$k = :$k";
313 313
         }
314 314
 
315 315
         $dataPlaceholder = implode(', ', $placeholder);
316 316
 
317 317
         $placeholder = [];
318
-        foreach($where as $k => $v) {
318
+        foreach ($where as $k => $v) {
319 319
             $placeholder[] = "$k = :$k";
320 320
         }
321 321
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 
328 328
             $bind = array_merge($data, $where);
329 329
     
330
-            foreach($bind as $k => $v) {
330
+            foreach ($bind as $k => $v) {
331 331
 
332 332
                 // @codeCoverageIgnoreStart
333 333
 
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
 
356 356
         // @codeCoverageIgnoreStart
357 357
         
358
-        } catch(Exception $e) {
358
+        } catch (Exception $e) {
359 359
             throw $e->getMessage();
360 360
             return false;
361 361
         }
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     {
376 376
         $placeholderField = [];
377 377
         $placeholderValue = [];
378
-        foreach($data as $k => $v) {
378
+        foreach ($data as $k => $v) {
379 379
             $placeholderField[] = "`$k`";
380 380
             $placeholderValue[] = ":$k";
381 381
         }
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
             $sql = 'INSERT INTO ' . $table . ' (' . $dataPlaceholderField . ') VALUES (' . $dataPlaceholderValue . ')';
388 388
             $query = $this->db->prepare($sql);
389 389
 
390
-            foreach($data as $k => $v) {
390
+            foreach ($data as $k => $v) {
391 391
 
392 392
                 // @codeCoverageIgnoreStart
393 393
 
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 
416 416
         // @codeCoverageIgnoreStart
417 417
 
418
-        } catch(Exception $e) {
418
+        } catch (Exception $e) {
419 419
             return false;
420 420
         }
421 421
 
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
     {
435 435
 
436 436
         $placeholder = [];
437
-        foreach($where as $k => $v) {
437
+        foreach ($where as $k => $v) {
438 438
             $placeholder[] = "`$k` = :$k";
439 439
         }
440 440
 
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
             $sql = 'DELETE FROM ' . $table . ' WHERE ' . $dataPlaceholder;
446 446
             $query = $this->db->prepare($sql);
447 447
 
448
-            foreach($where as $k => $v) {
448
+            foreach ($where as $k => $v) {
449 449
 
450 450
                 // @codeCoverageIgnoreStart
451 451
 
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 
469 469
         // @codeCoverageIgnoreStart
470 470
 
471
-        } catch(Exception $e) {
471
+        } catch (Exception $e) {
472 472
             return false;
473 473
         }
474 474
 
Please login to merge, or discard this patch.
src/Firewall/Panel/Sandbox/Mailgun.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
             $messenger = new MailgunTest($apiKey, $domain);
58 58
 
59
-            foreach($recipients as $recipient) {
59
+            foreach ($recipients as $recipient) {
60 60
                 if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
61 61
                     $messenger->addRecipient($recipient);
62 62
                 }
Please login to merge, or discard this patch.
src/Firewall/Panel/Sandbox/PhpNativeMail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
 
55 55
             $messenger = new MailTest();
56 56
 
57
-            foreach($recipients as $recipient) {
57
+            foreach ($recipients as $recipient) {
58 58
                 if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
59 59
                     $messenger->addRecipient($recipient);
60 60
                 }
Please login to merge, or discard this patch.
src/Firewall/Panel/Sandbox/Sendgrid.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 
57 57
             $messenger = new SendgridTest($apiKey);
58 58
 
59
-            foreach($recipients as $recipient) {
59
+            foreach ($recipients as $recipient) {
60 60
                 if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
61 61
                     $messenger->addRecipient($recipient);
62 62
                 }
Please login to merge, or discard this patch.
src/Firewall/Panel/Sandbox/Smtp.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 
70 70
             $messenger = new SmtpTest($user, $pass, $host, (int) $port);
71 71
 
72
-            foreach($recipients as $recipient) {
72
+            foreach ($recipients as $recipient) {
73 73
                 if (filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
74 74
                     $messenger->addRecipient($recipient);
75 75
                 }
Please login to merge, or discard this patch.