Passed
Push — 2.x ( 335e99...b197ca )
by Terry
01:56
created
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.
src/Firewall/Messenger/ItemSmtp.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 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
-        $host       = $setting['config']['host']       ?? '';
36
-        $user       = $setting['config']['user']       ?? '';
37
-        $pass       = $setting['config']['pass']       ?? '';
35
+        $host       = $setting['config']['host'] ?? '';
36
+        $user       = $setting['config']['user'] ?? '';
37
+        $pass       = $setting['config']['pass'] ?? '';
38 38
         $port       = $setting['config']['port'] ?? '';
39 39
 
40 40
         $instance = new Smtp($user, $pass, $host, (int) $port);
Please login to merge, or discard this patch.
src/Firewall/Messenger/ItemSlack.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
     public static function get(array $setting): MessengerInterface
31 31
     {
32 32
         $botToken = $setting['config']['bot_token'] ?? '';
33
-        $channel  = $setting['config']['channel']   ?? '';
33
+        $channel  = $setting['config']['channel'] ?? '';
34 34
 
35 35
         return new Slack($botToken, $channel);
36 36
     }
Please login to merge, or discard this patch.
src/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.