Passed
Push — 2.x ( ad8aea...da19d0 )
by Terry
01:55
created
src/Firewall/Firewall/Messenger/ItemPhpNativeMail.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     public static function get(array $setting): MessengerInterface
32 32
     {
33
-        $sender     = $setting['config']['sender']     ?? '';
33
+        $sender     = $setting['config']['sender'] ?? '';
34 34
         $recipients = $setting['config']['recipients'] ?? [];
35 35
 
36 36
         $instance = new Mail();
Please login to merge, or discard this patch.
src/Firewall/Firewall/Messenger/ItemRocketChat.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,10 +29,10 @@
 block discarded – undo
29 29
      */
30 30
     public static function get(array $setting): MessengerInterface
31 31
     {
32
-        $serverUrl   = $setting['config']['server_url']   ?? '';
33
-        $userId      = $setting['config']['user_id']      ?? '';
32
+        $serverUrl   = $setting['config']['server_url'] ?? '';
33
+        $userId      = $setting['config']['user_id'] ?? '';
34 34
         $accessToken = $setting['config']['access_token'] ?? '';
35
-        $channel     = $setting['config']['channel']      ?? '';
35
+        $channel     = $setting['config']['channel'] ?? '';
36 36
 
37 37
         return new RocketChat($accessToken, $userId, $serverUrl, $channel);
38 38
     }
Please login to merge, or discard this patch.
src/Firewall/Firewall/Driver/ItemMysqlDriver.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             // Create a PDO instance.
38 38
             $pdoInstance = new PDO(
39 39
                 'mysql:host=' 
40
-                    . $setting['host']   . ';dbname=' 
40
+                    . $setting['host'] . ';dbname=' 
41 41
                     . $setting['dbname'] . ';charset=' 
42 42
                     . $setting['charset']
43 43
                 , (string) $setting['user']
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
         // @codeCoverageIgnoreStart
51 51
 
52
-        } catch(PDOException $e) {
52
+        } catch (PDOException $e) {
53 53
             echo $e->getMessage();
54 54
         }
55 55
 
Please login to merge, or discard this patch.
templates/frontend/login.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
 				<div class="card-body">
120 120
                     <form action="<?php echo $form ?>" method="post" autocomplete="off">
121 121
                         <div class="main-content">
122
-                            <?php if (! empty($error)) : ?>
122
+                            <?php if (!empty($error)) : ?>
123 123
                             <div class="error-notice">
124 124
                                 <?php echo $error; ?>
125 125
                             </div>
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                             <div class="input-box">
131 131
                                 <input type="password" name="s_pass" placeholder="Password" class="form-input" />
132 132
                             </div>
133
-                            <?php if (! empty($captchas)) : ?>
133
+                            <?php if (!empty($captchas)) : ?>
134 134
                             <div class="input-box">
135 135
                                 <?php foreach ($captchas as $captcha) : ?>
136 136
                                     <?php echo $captcha->form(); ?>
Please login to merge, or discard this patch.
src/Firewall/Kernel.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      * 
209 209
      * @return void
210 210
      */
211
-    public function __construct(?ServerRequestInterface $request  = null, ?ResponseInterface $response = null)
211
+    public function __construct(?ServerRequestInterface $request = null, ?ResponseInterface $response = null)
212 212
     {
213 213
         // Load helper functions. This is the must.
214 214
         new Helpers();
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
         $this->initComponents();
659 659
 
660 660
         $processMethods = [
661
-            'isRuleExist',   // Stage 1 - Looking for rule table.
662
-            'isTrustedBot',  // Stage 2 - Detect popular search engine.
663
-            'isFakeRobot',   // Stage 3 - Reject fake search engine crawlers.
661
+            'isRuleExist', // Stage 1 - Looking for rule table.
662
+            'isTrustedBot', // Stage 2 - Detect popular search engine.
663
+            'isFakeRobot', // Stage 3 - Reject fake search engine crawlers.
664 664
             'isIpComponent', // Stage 4 - IP manager.
665 665
             'isComponents'   // Stage 5 - Check other components.
666 666
         ];
Please login to merge, or discard this patch.
src/Firewall/Captcha/ImageCaptcha.php 1 patch
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             'colors'       => [
101 101
                 'background' => [255, 255, 255],
102 102
                 'border'     => [153, 200, 255],
103
-                'text'       => [51,  153, 255],
103
+                'text'       => [51, 153, 255],
104 104
                 'grid'       => [153, 200, 255]
105 105
             ]
106 106
         ];
@@ -319,14 +319,12 @@  discard block
 block discarded – undo
319 319
     {
320 320
         // Determine angle and position.
321 321
         $angle = ($this->length >= 6) ?
322
-            mt_rand(-($this->length - 6), ($this->length - 6)) :
323
-            0;
322
+            mt_rand(-($this->length - 6), ($this->length - 6)) : 0;
324 323
 
325 324
         $xAxis = mt_rand(6, (360 / $this->length) - 16);
326 325
 
327 326
         $yAxis = ($angle >= 0) ?
328
-            mt_rand($imgHeight, $imgWidth) :
329
-            mt_rand(6, $imgHeight);
327
+            mt_rand($imgHeight, $imgWidth) : mt_rand(6, $imgHeight);
330 328
 
331 329
         // Create the spiral pattern.
332 330
         $theta = 1;
@@ -369,7 +367,7 @@  discard block
 block discarded – undo
369 367
         $y = 0;
370 368
 
371 369
         for ($i = 0; $i < $this->length; $i++) {
372
-            $y = mt_rand(0 , $imgHeight / 2);
370
+            $y = mt_rand(0, $imgHeight / 2);
373 371
             imagestring($this->im, 5, $x, $y, $this->word[$i], $textColor);
374 372
             $x += ($this->properties['font_spacing'] * 2);
375 373
         }
@@ -398,7 +396,7 @@  discard block
 block discarded – undo
398 396
     private function getImageBase64Content(): string
399 397
     {
400 398
         // Generate image in base64 string.
401
-        ob_start ();
399
+        ob_start();
402 400
 
403 401
         if (function_exists('imagejpeg')) {
404 402
             $this->imageType = 'jpeg';
Please login to merge, or discard this patch.
src/Firewall/Firewall/MainTrait.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
         $this->kernel->setProperty('time_unit_quota', $frequencyQuota);
105 105
 
106 106
         // if ($cookieSetting['enable']) {
107
-        $cookieName   = $settings['cookie']['config']['cookie_name']   ?? 'ssjd';
107
+        $cookieName   = $settings['cookie']['config']['cookie_name'] ?? 'ssjd';
108 108
         $cookieDomain = $settings['cookie']['config']['cookie_domain'] ?? '';
109
-        $cookieValue  = $settings['cookie']['config']['cookie_value']  ?? '1';
109
+        $cookieValue  = $settings['cookie']['config']['cookie_value'] ?? '1';
110 110
 
111 111
         $this->kernel->setProperty('cookie_name', $cookieName);
112 112
         $this->kernel->setProperty('cookie_domain', $cookieDomain);
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         if (is_array($ipList)) {
228 228
             foreach ($ipList as $ip) {
229 229
 
230
-                if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url']) ) {
230
+                if (0 === strpos($this->kernel->getCurrentUrl(), $ip['url'])) {
231 231
     
232 232
                     if ('allow' === $ip['rule']) {
233 233
                         $allowedList[] = $ip['ip'];
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
     {
297 297
         $setting = $this->getOption('failed_attempts_in_a_row', 'events');
298 298
 
299
-        $enableDataCircle     = $setting['data_circle']['enable']     ?: false;
299
+        $enableDataCircle     = $setting['data_circle']['enable'] ?: false;
300 300
         $enableSystemFirewall = $setting['system_firewall']['enable'] ?: false;
301 301
 
302 302
         $this->kernel->setProperty('deny_attempt_enable', [
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
         $recordAttempt = $this->getOption('record_attempt');
314 314
 
315 315
         $detectionPeriod = $recordAttempt['detection_period'] ?? 5;
316
-        $timeToReset     = $recordAttempt['time_to_reset']    ?? 1800;
316
+        $timeToReset     = $recordAttempt['time_to_reset'] ?? 1800;
317 317
 
318 318
         $this->kernel->setProperty('record_attempt_detection_period', $detectionPeriod);
319 319
         $this->kernel->setProperty('reset_attempt_counter', $timeToReset);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
     protected function setIptablesBridgeDirectory(): void
328 328
     {
329 329
         $iptablesSetting = $this->getOption('config', 'iptables');
330
-        $this->kernel->setProperty('iptables_watching_folder',  $iptablesSetting['watching_folder']);
330
+        $this->kernel->setProperty('iptables_watching_folder', $iptablesSetting['watching_folder']);
331 331
     }
332 332
 
333 333
     /**
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         if ($sessionLimitSetting['enable']) {
343 343
 
344
-            $onlineUsers = $sessionLimitSetting['config']['count']  ?? 100;
344
+            $onlineUsers = $sessionLimitSetting['config']['count'] ?? 100;
345 345
             $alivePeriod = $sessionLimitSetting['config']['period'] ?? 300;
346 346
 
347 347
             $this->kernel->limitSession($onlineUsers, $alivePeriod);
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
 
369 369
             $lastResetTime = $cronjobSetting['config']['last_update'];
370 370
 
371
-            if (!empty($lastResetTime) ) {
371
+            if (!empty($lastResetTime)) {
372 372
                 $lastResetTime = strtotime($lastResetTime);
373 373
             } else {
374 374
                 // @codeCoverageIgnoreStart
Please login to merge, or discard this patch.