Completed
Branch 1.x (bc5d7e)
by Terry
07:07 queued 05:06
created
src/Shieldon/Component/ComponentProvider.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public function setDeniedItem(string $string): void
52 52
     {
53
-        if (! in_array($string, $this->deniedList)) {
53
+        if (!in_array($string, $this->deniedList)) {
54 54
             array_push($this->deniedList, $string);
55 55
         }
56 56
     }
@@ -86,16 +86,16 @@  discard block
 block discarded – undo
86 86
      */
87 87
     public function removeItem(string $string): void
88 88
     {
89
-        if (! empty($this->allowedList)) {
89
+        if (!empty($this->allowedList)) {
90 90
             $key = array_search($string, $this->allowedList);
91
-            if (false !==  $key) {
91
+            if (false !== $key) {
92 92
                 unset($this->allowedList[$key]);
93 93
             }
94 94
         }
95 95
 
96
-        if (! empty($this->deniedList)) {
96
+        if (!empty($this->deniedList)) {
97 97
             $key = array_search($string, $this->deniedList);
98
-            if (false !==  $key) {
98
+            if (false !== $key) {
99 99
                 unset($this->deniedList[$key]);
100 100
             }
101 101
         }
Please login to merge, or discard this patch.
src/Shieldon/Component/TrustedBot.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             ],
155 155
         ];
156 156
 
157
-        if (! empty($_SERVER['HTTP_USER_AGENT'])) {
157
+        if (!empty($_SERVER['HTTP_USER_AGENT'])) {
158 158
             $this->userAgentString = $_SERVER['HTTP_USER_AGENT'];
159 159
         }
160 160
     }
@@ -164,11 +164,11 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function isAllowed(): bool
166 166
     {
167
-        if (! empty($this->trustedBotList)) {
167
+        if (!empty($this->trustedBotList)) {
168 168
 
169 169
             $userAgent = array_unique(array_column($this->trustedBotList, 'userAgent'));
170 170
 
171
-            if (! preg_match('/(' . implode('|', $userAgent) . ')/i', $this->userAgentString)) {
171
+            if (!preg_match('/(' . implode('|', $userAgent) . ')/i', $this->userAgentString)) {
172 172
                 // Okay, current request's user-agent string doesn't contain our truested bots' infroamtion.
173 173
                 // Ignore it.
174 174
                 return false;
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
                 if ($this->checkFakeRdns) {
216 216
 
217 217
                     // We can identify that current access uses a fake RDNS record.
218
-                    if (! $rdnsCheck) {
218
+                    if (!$rdnsCheck) {
219 219
                         $this->isFake = true;
220 220
                         return false;
221 221
                     }
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
      */
261 261
     public function addList(array $list): void
262 262
     {
263
-        if (! empty($list[0]['userAgent']) && ! empty($list[0]['rdns']) && 2 === count($list[0])) {
263
+        if (!empty($list[0]['userAgent']) && !empty($list[0]['rdns']) && 2 === count($list[0])) {
264 264
 
265 265
             // Append the new list to the end.
266 266
             $this->trustedBotList = array_merge($this->trustedBotList, $list);
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
      */
297 297
     public function removeItem(string $string): void
298 298
     {
299
-        if (! empty($this->trustedBotList)) {
299
+        if (!empty($this->trustedBotList)) {
300 300
             foreach ($this->trustedBotList as $index => $list) {
301 301
                 if ($list['userAgent'] === $string) {
302 302
                     unset($this->trustedBotList[$index]);
Please login to merge, or discard this patch.
src/Shieldon/Component/Ip.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         $ip = $ipData[0];
258 258
         $cidr = (int) $ipData[1] ?? 32;
259 259
 
260
-		$result[0] = long2ip((ip2long($ip)) & ((-1 << (32 - $cidr))));
260
+        $result[0] = long2ip((ip2long($ip)) & ((-1 << (32 - $cidr))));
261 261
         $result[1] = long2ip((ip2long($ip)) + pow(2, (32 - $cidr)) - 1);
262 262
 
263 263
         if ($isDecimal) {
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
             $result[1] = ip2long($result[1]);
266 266
         }
267 267
 
268
-		return $result;
268
+        return $result;
269 269
     }
270 270
 
271 271
     /**
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             $this->setIp($ip);
70 70
         }
71 71
 
72
-        if (! filter_var($this->ip, FILTER_VALIDATE_IP)) {
72
+        if (!filter_var($this->ip, FILTER_VALIDATE_IP)) {
73 73
             return [
74 74
                 'status' => 'deny',
75 75
                 'code' => self::REASON_INVALID_IP,
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
      */
367 367
     public function setAllowedItem(string $string): void
368 368
     {
369
-        if (! in_array($string, $this->allowedList)) {
369
+        if (!in_array($string, $this->allowedList)) {
370 370
             array_push($this->allowedList, $string);
371 371
         }
372 372
     }
Please login to merge, or discard this patch.
src/Shieldon/Integration/Bootstrapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
 
46 46
             $firewall = new Firewall($storage);
47 47
 
48
-            if (! empty($requestURI) && 0 === strpos($_SERVER['REQUEST_URI'], $requestURI)) {
48
+            if (!empty($requestURI) && 0 === strpos($_SERVER['REQUEST_URI'], $requestURI)) {
49 49
 
50 50
                 // Get into the Firewall Panel.
51 51
                 $controlPanel = new FirewallPanel($firewall);
Please login to merge, or discard this patch.
src/Shieldon/Integration/CodeIgniter/CI4Middleware.php 1 patch
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -43,41 +43,41 @@
 block discarded – undo
43 43
         }
44 44
     }
45 45
 
46
-	/**
46
+    /**
47 47
      * Shieldon middleware invokable class.
48 48
      *
49
-	 * @param Request $request
50
-	 *
51
-	 * @return mixed
52
-	 */
53
-	public function before(Request $request)
54
-	{
55
-		if ($request->isCLI()) {
56
-			return;
57
-		}
49
+     * @param Request $request
50
+     *
51
+     * @return mixed
52
+     */
53
+    public function before(Request $request)
54
+    {
55
+        if ($request->isCLI()) {
56
+            return;
57
+        }
58 58
 
59 59
         $firewall = new Firewall($this->storage);
60 60
 
61 61
         // Pass CodeIgniter CSRF Token to Captcha form.
62 62
         $firewall->getShieldon()->setCaptcha(new \Shieldon\Captcha\Csrf([
63
-			'name' => csrf_token(),
64
-			'value' => csrf_hash(),
63
+            'name' => csrf_token(),
64
+            'value' => csrf_hash(),
65 65
         ]));
66 66
 
67 67
         $firewall->restful();
68 68
         $firewall->run();
69
-	}
69
+    }
70 70
 
71
-	/**
72
-	 * We don't have anything to do here.
73
-	 *
74
-	 * @param Response $request
75
-	 * @param Response $response
76
-	 *
77
-	 * @return mixed
78
-	 */
79
-	public function after(Request $request, Response $response)
80
-	{
71
+    /**
72
+     * We don't have anything to do here.
73
+     *
74
+     * @param Response $request
75
+     * @param Response $response
76
+     *
77
+     * @return mixed
78
+     */
79
+    public function after(Request $request, Response $response)
80
+    {
81 81
 
82 82
     }
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/Shieldon/Firewall.php 1 patch
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             $this->directory = rtrim($source, '\\/');
84 84
             $configFilePath = $this->directory . '/' . $this->filename;
85 85
 
86
-            if (! file_exists($configFilePath)) {
86
+            if (!file_exists($configFilePath)) {
87 87
 
88 88
                 $jsonString = file_get_contents(__DIR__ . '/../../config.json');
89 89
 
@@ -230,11 +230,11 @@  discard block
 block discarded – undo
230 230
                     $host = '127.0.0.1';
231 231
                     $port = 6379;
232 232
 
233
-                    if (! empty($redisSetting['host'])) {
233
+                    if (!empty($redisSetting['host'])) {
234 234
                         $host = $redisSetting['host'];
235 235
                     }
236 236
 
237
-                    if (! empty($redisSetting['port'])) {
237
+                    if (!empty($redisSetting['port'])) {
238 238
                         $port = $redisSetting['port'];
239 239
                     }
240 240
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
                     $redis = new Redis();
243 243
                     $redis->connect($host, $port);
244 244
 
245
-                    if (! empty($redisSetting['auth'])) {
245
+                    if (!empty($redisSetting['auth'])) {
246 246
 
247 247
                         // @codeCoverageIgnoreStart
248 248
                         $redis->auth($redisSetting['auth']);
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
                     $this->shieldon->setDriver(new RedisDriver($redis));
254 254
 
255 255
                 // @codeCoverageIgnoreStart
256
-                } catch(RedisException $e) {
256
+                } catch (RedisException $e) {
257 257
                     $this->status = false;
258 258
 
259 259
                     echo $e->getMessage();
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                     $this->shieldon->setDriver(new SqliteDriver($pdoInstance));
297 297
     
298 298
                 // @codeCoverageIgnoreStart
299
-                } catch(PDOException $e) {
299
+                } catch (PDOException $e) {
300 300
                     $this->status = false;
301 301
 
302 302
                     echo $e->getMessage();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                     // Create a PDO instance.
316 316
                     $pdoInstance = new PDO(
317 317
                         'mysql:host=' 
318
-                            . $mysqlSetting['host']   . ';dbname=' 
318
+                            . $mysqlSetting['host'] . ';dbname=' 
319 319
                             . $mysqlSetting['dbname'] . ';charset=' 
320 320
                             . $mysqlSetting['charset']
321 321
                         , (string) $mysqlSetting['user']
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                     $this->shieldon->setDriver(new MysqlDriver($pdoInstance));
327 327
 
328 328
                 // @codeCoverageIgnoreStart
329
-                } catch(PDOException $e) {
329
+                } catch (PDOException $e) {
330 330
                     echo $e->getMessage();
331 331
                 }
332 332
                 // @codeCoverageIgnoreEnd
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
         $loggerSetting = $this->getOption('action', 'loggers');
345 345
 
346 346
         if ($loggerSetting['enable']) {
347
-            if (! empty($loggerSetting['config']['directory_path'])) {
347
+            if (!empty($loggerSetting['config']['directory_path'])) {
348 348
                 $this->shieldon->setLogger(new ActionLogger($loggerSetting['config']['directory_path']));
349 349
             }
350 350
         }
@@ -574,8 +574,8 @@  discard block
 block discarded – undo
574 574
 
575 575
         $messageTitle = 'Firewall Notification';
576 576
 
577
-        if (! empty($telegramSetting['enable'])) {
578
-            if (! empty($telegramSetting['confirm_test'])) {
577
+        if (!empty($telegramSetting['enable'])) {
578
+            if (!empty($telegramSetting['confirm_test'])) {
579 579
                 $apiKey = $telegramSetting['config']['api_key'] ?? '';
580 580
                 $channel = $telegramSetting['config']['channel'] ?? '';
581 581
                 $this->shieldon->setMessenger(
@@ -584,8 +584,8 @@  discard block
 block discarded – undo
584 584
             }
585 585
         }
586 586
 
587
-        if (! empty($linenotodySetting['enable'])) {
588
-            if (! empty($linenotodySetting['confirm_test'])) {
587
+        if (!empty($linenotodySetting['enable'])) {
588
+            if (!empty($linenotodySetting['confirm_test'])) {
589 589
                 $accessToken = $linenotodySetting['config']['access_token'] ?? '';
590 590
                 $this->shieldon->setMessenger(
591 591
                     new MessengerModule\LineNotify($accessToken)
@@ -593,8 +593,8 @@  discard block
 block discarded – undo
593 593
             }
594 594
         }
595 595
 
596
-        if (! empty($sendgridSetting['enable'])) {
597
-            if (! empty($sendgridSetting['confirm_test'])) {
596
+        if (!empty($sendgridSetting['enable'])) {
597
+            if (!empty($sendgridSetting['confirm_test'])) {
598 598
                 $apiKey = $sendgridSetting['config']['api_key'] ?? '';
599 599
                 $sender = $sendgridSetting['config']['sender'] ?? '';
600 600
                 $recipients = $sendgridSetting['config']['recipients'] ?? [];
@@ -611,8 +611,8 @@  discard block
 block discarded – undo
611 611
             }
612 612
         }
613 613
 
614
-        if (! empty($phpMailSetting['enable'])) {
615
-            if (! empty($phpMailSetting['confirm_test'])) {
614
+        if (!empty($phpMailSetting['enable'])) {
615
+            if (!empty($phpMailSetting['confirm_test'])) {
616 616
                 $sender = $phpMailSetting['config']['sender'] ?? '';
617 617
                 $recipients = $phpMailSetting['config']['recipients'] ?? [];
618 618
 
@@ -628,8 +628,8 @@  discard block
 block discarded – undo
628 628
             }
629 629
         }
630 630
 
631
-        if (! empty($smtpSetting['enable'])) {
632
-            if (! empty($smtpSetting['confirm_test'])) {
631
+        if (!empty($smtpSetting['enable'])) {
632
+            if (!empty($smtpSetting['confirm_test'])) {
633 633
                 $sender = $smtpSetting['config']['sender'] ?? '';
634 634
                 $recipients = $smtpSetting['config']['recipients'] ?? [];
635 635
                 $host = $smtpSetting['config']['host'] ?? '';
@@ -649,8 +649,8 @@  discard block
 block discarded – undo
649 649
             }
650 650
         }
651 651
 
652
-        if (! empty($mailgunSetting['enable'])) {
653
-            if (! empty($mailgunSetting['confirm_test'])) {
652
+        if (!empty($mailgunSetting['enable'])) {
653
+            if (!empty($mailgunSetting['confirm_test'])) {
654 654
                 $apiKey = $mailgunSetting['config']['api_key'] ?? '';
655 655
                 $domain = $mailgunSetting['config']['domain_name'] ?? '';
656 656
                 $sender = $mailgunSetting['config']['sender'] ?? '';
@@ -668,8 +668,8 @@  discard block
 block discarded – undo
668 668
             }
669 669
         }
670 670
 
671
-        if (! empty($rocketchatSetting['enable'])) {
672
-            if (! empty($rocketchatSetting['confirm_test'])) {
671
+        if (!empty($rocketchatSetting['enable'])) {
672
+            if (!empty($rocketchatSetting['confirm_test'])) {
673 673
                 $serverUrl = $rocketchatSetting['config']['server_url'] ?? '';
674 674
                 $userId = $rocketchatSetting['config']['user_id'] ?? '';
675 675
                 $accessToken = $rocketchatSetting['config']['access_token'] ?? '';
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
             }
684 684
         }
685 685
 
686
-        if (! empty($slackSetting['enable'])) {
687
-            if (! empty($slackSetting['confirm_test'])) {
686
+        if (!empty($slackSetting['enable'])) {
687
+            if (!empty($slackSetting['confirm_test'])) {
688 688
                 $botToken = $slackSetting['config']['bot_token'] ?? '';
689 689
                 $channel = $slackSetting['config']['channel'] ?? '';
690 690
 
@@ -694,8 +694,8 @@  discard block
 block discarded – undo
694 694
             }
695 695
         }
696 696
 
697
-        if (! empty($slackWebhookSetting['enable'])) {
698
-            if (! empty($slackWebhookSetting['confirm_test'])) {
697
+        if (!empty($slackWebhookSetting['enable'])) {
698
+            if (!empty($slackWebhookSetting['confirm_test'])) {
699 699
                 $webhookUrl = $slackWebhookSetting['config']['webhook_url'] ?? '';
700 700
 
701 701
                 $this->shieldon->setMessenger(
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
     protected function setIptablesWatchingFolder(): void
780 780
     {
781 781
         $iptablesSetting = $this->getOption('config', 'iptables');
782
-        $this->shieldon->setProperty('iptables_watching_folder',  $iptablesSetting['watching_folder']);
782
+        $this->shieldon->setProperty('iptables_watching_folder', $iptablesSetting['watching_folder']);
783 783
     }
784 784
 
785 785
     /**
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 
817 817
             $lastResetTime = $cronjobSetting['config']['last_update'];
818 818
 
819
-            if (! empty($lastResetTime) ) {
819
+            if (!empty($lastResetTime)) {
820 820
                 $lastResetTime = strtotime($lastResetTime);
821 821
             } else {
822 822
                 // @codeCoverageIgnoreStart
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
     {
848 848
         $excludedUrls = $this->getOption('excluded_urls');
849 849
 
850
-        if (! empty($excludedUrls)) {
850
+        if (!empty($excludedUrls)) {
851 851
             $list = array_column($excludedUrls, 'url');
852 852
 
853 853
             $this->shieldon->setExcludedUrls($list);
@@ -867,7 +867,7 @@  discard block
 block discarded – undo
867 867
 
868 868
         if ($xssProtectionOptions['post']) {
869 869
             $this->shieldon->setClosure('xss_post', function() use ($xssFilter) {
870
-                if (! empty($_POST)) {
870
+                if (!empty($_POST)) {
871 871
                     foreach (array_keys($_POST) as $k) {
872 872
                         $_POST[$k] = $xssFilter->clean($_POST[$k]);
873 873
                     }
@@ -877,7 +877,7 @@  discard block
 block discarded – undo
877 877
 
878 878
         if ($xssProtectionOptions['get']) {
879 879
             $this->shieldon->setClosure('xss_get', function() use ($xssFilter) {
880
-                if (! empty($_GET)) {
880
+                if (!empty($_GET)) {
881 881
                     foreach (array_keys($_GET) as $k) {
882 882
                         $_GET[$k] = $xssFilter->clean($_GET[$k]);
883 883
                     }
@@ -887,7 +887,7 @@  discard block
 block discarded – undo
887 887
 
888 888
         if ($xssProtectionOptions['cookie']) {
889 889
             $this->shieldon->setClosure('xss_cookie', function() use ($xssFilter) {
890
-                if (! empty($_COOKIE)) {
890
+                if (!empty($_COOKIE)) {
891 891
                     foreach (array_keys($_COOKIE) as $k) {
892 892
                         $_COOKIE[$k] = $xssFilter->clean($_COOKIE[$k]);
893 893
                     }
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 
898 898
         $xssProtectedList = $this->getOption('xss_protected_list');
899 899
 
900
-        if (! empty($xssProtectedList)) {
900
+        if (!empty($xssProtectedList)) {
901 901
         
902 902
             $this->shieldon->setClosure('xss_protection', function() use ($xssFilter, $xssProtectedList) {
903 903
 
@@ -908,21 +908,21 @@  discard block
 block discarded – undo
908 908
 
909 909
                         case 'get':
910 910
 
911
-                            if (! empty($_GET[$k])) {
911
+                            if (!empty($_GET[$k])) {
912 912
                                 $_GET[$k] = $xssFilter->clean($_GET[$k]);
913 913
                             }
914 914
                             break;
915 915
     
916 916
                         case 'post':
917 917
     
918
-                            if (! empty($_POST[$k])) {
918
+                            if (!empty($_POST[$k])) {
919 919
                                 $_POST[$k] = $xssFilter->clean($_POST[$k]);
920 920
                             }
921 921
                             break;
922 922
     
923 923
                         case 'cookie':
924 924
 
925
-                            if (! empty($_COOKIE[$k])) {
925
+                            if (!empty($_COOKIE[$k])) {
926 926
                                 $_COOKIE[$k] = $xssFilter->clean($_COOKIE[$k]);
927 927
                             }
928 928
                             break;
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
     {
944 944
         $authenticateList = $this->getOption('www_authenticate');
945 945
 
946
-        if (! empty($authenticateList)) {
946
+        if (!empty($authenticateList)) {
947 947
 
948 948
             $authHandler = new httpAuthentication();
949 949
 
@@ -964,10 +964,10 @@  discard block
 block discarded – undo
964 964
         $allowedList = [];
965 965
         $deniedList = [];
966 966
 
967
-        if (! empty($ipList)) {
967
+        if (!empty($ipList)) {
968 968
             foreach ($ipList as $ip) {
969 969
 
970
-                if (0 === strpos($this->shieldon->getCurrentUrl(), $ip['url']) ) {
970
+                if (0 === strpos($this->shieldon->getCurrentUrl(), $ip['url'])) {
971 971
     
972 972
                     if ('allow' === $ip['rule']) {
973 973
                         $allowedList[] = $ip['ip'];
@@ -980,11 +980,11 @@  discard block
 block discarded – undo
980 980
             }
981 981
         }
982 982
 
983
-        if (! empty($allowedList)) {
983
+        if (!empty($allowedList)) {
984 984
             $this->shieldon->component['Ip']->setAllowedList($allowedList);
985 985
         }
986 986
 
987
-        if (! empty($deniedList)) {
987
+        if (!empty($deniedList)) {
988 988
             $this->shieldon->component['Ip']->setDeniedList($deniedList);
989 989
         }
990 990
     }
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
     {
999 999
         $ui = $this->getOption('dialog_ui');
1000 1000
 
1001
-        if (! empty($ui)) {
1001
+        if (!empty($ui)) {
1002 1002
             $_SESSION['SHIELDON_UI_LANG'] = $ui['lang'];
1003 1003
             $this->shieldon->setDialogUI($this->getOption('dialog_ui'));
1004 1004
         }
@@ -1017,11 +1017,11 @@  discard block
 block discarded – undo
1017 1017
      */
1018 1018
     private function getOption(string $option, string $section = '')
1019 1019
     {
1020
-        if (! empty($this->configuration[$section][$option])) {
1020
+        if (!empty($this->configuration[$section][$option])) {
1021 1021
             return $this->configuration[$section][$option];
1022 1022
         }
1023 1023
 
1024
-        if (! empty($this->configuration[$option]) && $section === '') {
1024
+        if (!empty($this->configuration[$option]) && $section === '') {
1025 1025
             return $this->configuration[$option];
1026 1026
         }
1027 1027
 
@@ -1037,8 +1037,8 @@  discard block
 block discarded – undo
1037 1037
     {
1038 1038
         $configFilePath = $this->directory . '/' . $this->filename;
1039 1039
 
1040
-        if (! file_exists($configFilePath)) {
1041
-            if (! is_dir($this->directory)) {
1040
+        if (!file_exists($configFilePath)) {
1041
+            if (!is_dir($this->directory)) {
1042 1042
                 // @codeCoverageIgnoreStart
1043 1043
                 $originalUmask = umask(0);
1044 1044
                 @mkdir($this->directory, 0777, true);
Please login to merge, or discard this patch.
templates/panel/action_log_last_month.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 ?>
15 15
 
16 16
 <div class="so-dashboard">
17
-    <?php if (! empty($period_data)) : ?>
17
+    <?php if (!empty($period_data)) : ?>
18 18
     <div class="so-flex">
19 19
         <div class="so-board">
20 20
             <div class="board-field left">
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
                 </tr>
86 86
             </thead>
87 87
             <tbody>
88
-                <?php if (! empty($ip_details)) : ?>
89
-                <?php foreach($ip_details as $ip => $ipInfo) : ?>
88
+                <?php if (!empty($ip_details)) : ?>
89
+                <?php foreach ($ip_details as $ip => $ipInfo) : ?>
90 90
                 <tr>
91 91
                     <td>
92 92
                         <?php if ($this->mode === 'demo') : ?>
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         </table>
109 109
     </div>
110 110
     <div class="so-timezone">
111
-        <?php if (! empty($last_cached_time)) : ?>
111
+        <?php if (!empty($last_cached_time)) : ?>
112 112
             <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong>
113 113
             &nbsp;&nbsp;&nbsp;&nbsp; 
114 114
         <?php endif; ?>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 <?php
120 120
 
121
-    if (! empty($period_data)) {
121
+    if (!empty($period_data)) {
122 122
         $data['period_data'] = $period_data;
123 123
         $this->_include('panel/js/chart', $data);
124 124
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,12 @@
 block discarded – undo
60 60
                 </div>
61 61
             </div>
62 62
         </div>
63
-    <?php else : ?>
63
+    <?php else {
64
+    : ?>
64 65
         <div class="alert alert-danger">
65
-            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.'); ?>
66
+            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.');
67
+}
68
+?>
66 69
             
67 70
         </div>
68 71
     <?php endif; ?>
Please login to merge, or discard this patch.
templates/panel/action_log_this_month.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 ?>
15 15
 
16 16
 <div class="so-dashboard">
17
-    <?php if (! empty($period_data)) : ?>
17
+    <?php if (!empty($period_data)) : ?>
18 18
     <div class="so-flex">
19 19
         <div class="so-board">
20 20
             <div class="board-field left">
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
                 </tr>
86 86
             </thead>
87 87
             <tbody>
88
-                <?php if (! empty($ip_details)) : ?>
89
-                <?php foreach($ip_details as $ip => $ipInfo) : ?>
88
+                <?php if (!empty($ip_details)) : ?>
89
+                <?php foreach ($ip_details as $ip => $ipInfo) : ?>
90 90
                 <tr>
91 91
                     <td>
92 92
                         <?php if ($this->mode === 'demo') : ?>
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         </table>
109 109
     </div>
110 110
     <div class="so-timezone">
111
-        <?php if (! empty($last_cached_time)) : ?>
111
+        <?php if (!empty($last_cached_time)) : ?>
112 112
             <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong>
113 113
             &nbsp;&nbsp;&nbsp;&nbsp; 
114 114
         <?php endif; ?>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 <?php
120 120
 
121
-    if (! empty($period_data)) {
121
+    if (!empty($period_data)) {
122 122
         $data['period_data'] = $period_data;
123 123
         $this->_include('panel/js/chart', $data);
124 124
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,12 @@
 block discarded – undo
60 60
                 </div>
61 61
             </div>
62 62
         </div>
63
-    <?php else : ?>
63
+    <?php else {
64
+    : ?>
64 65
         <div class="alert alert-danger">
65
-            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.'); ?>
66
+            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.');
67
+}
68
+?>
66 69
             
67 70
         </div>
68 71
     <?php endif; ?>
Please login to merge, or discard this patch.
templates/panel/action_log_yesterday.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 ?>
15 15
 
16 16
 <div class="so-dashboard">
17
-    <?php if (! empty($period_data)) : ?>
17
+    <?php if (!empty($period_data)) : ?>
18 18
     <div class="so-flex">
19 19
         <div class="so-board">
20 20
             <div class="board-field left">
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
                 </tr>
86 86
             </thead>
87 87
             <tbody>
88
-                <?php if (! empty($ip_details)) : ?>
89
-                <?php foreach($ip_details as $ip => $ipInfo) : ?>
88
+                <?php if (!empty($ip_details)) : ?>
89
+                <?php foreach ($ip_details as $ip => $ipInfo) : ?>
90 90
                 <tr>
91 91
                     <td>
92 92
                         <?php if ($this->mode === 'demo') : ?>
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         </table>
109 109
     </div>
110 110
     <div class="so-timezone">
111
-        <?php if (! empty($last_cached_time)) : ?>
111
+        <?php if (!empty($last_cached_time)) : ?>
112 112
             <?php _e('panel', 'log_label_cache_time', 'Report generated time'); ?>: <strong class="text-info"><?php echo $last_cached_time; ?></strong>
113 113
             &nbsp;&nbsp;&nbsp;&nbsp; 
114 114
         <?php endif; ?>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 
119 119
 <?php
120 120
 
121
-    if (! empty($period_data)) {
121
+    if (!empty($period_data)) {
122 122
         $data['period_data'] = $period_data;
123 123
         $this->_include('panel/js/chart', $data);
124 124
     }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,9 +60,12 @@
 block discarded – undo
60 60
                 </div>
61 61
             </div>
62 62
         </div>
63
-    <?php else : ?>
63
+    <?php else {
64
+    : ?>
64 65
         <div class="alert alert-danger">
65
-            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.'); ?>
66
+            <?php _e('panel', 'log_msg_no_logger', 'Sorry, you have to implement ActionLogger to use this function.');
67
+}
68
+?>
66 69
             
67 70
         </div>
68 71
     <?php endif; ?>
Please login to merge, or discard this patch.