Passed
Push — develop ( c77ba7...d3c53a )
by nguereza
04:05
created
src/Http/InputClean.php 3 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -64,17 +64,17 @@  discard block
 block discarded – undo
64 64
         '\'', '"', '&', '$', '#',
65 65
         '{', '}', '[', ']', '=',
66 66
         ';', '?', '%20', '%22',
67
-        '%3c',      // <
68
-        '%253c',    // <
69
-        '%3e',      // >
70
-        '%0e',      // >
71
-        '%28',      // (
72
-        '%29',      // )
73
-        '%2528',    // (
74
-        '%26',      // &
75
-        '%24',      // $
76
-        '%3f',      // ?
77
-        '%3b',      // ;
67
+        '%3c', // <
68
+        '%253c', // <
69
+        '%3e', // >
70
+        '%0e', // >
71
+        '%28', // (
72
+        '%29', // )
73
+        '%2528', // (
74
+        '%26', // &
75
+        '%24', // $
76
+        '%3f', // ?
77
+        '%3b', // ;
78 78
         '%3d'       // =
79 79
     ];
80 80
 
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
             return $str;
149 149
         }
150 150
 
151
-        if ($str === '' || $str === null || is_bool($str) || ! $str || is_numeric($str)) {
151
+        if ($str === '' || $str === null || is_bool($str) || !$str || is_numeric($str)) {
152 152
             return $str;
153 153
         }
154 154
 
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
 
482 482
         $flag = ENT_COMPAT | ENT_HTML5;
483 483
 
484
-        if (! isset($entities)) {
484
+        if (!isset($entities)) {
485 485
             $entities = array_map(
486 486
                 'strtolower',
487 487
                 get_html_translation_table(HTML_ENTITIES, $flag, $charset)
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
         static $naughtyTags = [
558 558
             'alert', 'area', 'prompt', 'confirm', 'applet', 'audio', 'basefont',
559 559
             'base', 'behavior', 'bgsound', 'blink', 'body', 'embed', 'expression',
560
-            'form', 'frameset', 'frame', 'head', 'html', 'ilayer','iframe', 'input',
560
+            'form', 'frameset', 'frame', 'head', 'html', 'ilayer', 'iframe', 'input',
561 561
             'button', 'select', 'isindex', 'layer', 'link', 'meta', 'keygen', 'object',
562 562
             'plaintext', 'style', 'script', 'textarea', 'title', 'math', 'video', 'svg',
563 563
             'xml', 'xss'
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
                 );
602 602
                 $attribute = [];
603 603
                 if (
604
-                    ! preg_match(
604
+                    !preg_match(
605 605
                         $attributesPattern,
606 606
                         $matches['attributes'],
607 607
                         $attribute,
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
                     $attributes[] = $attribute[0][0];
624 624
                 }
625 625
 
626
-                $matches['attributes']  = (string) substr(
626
+                $matches['attributes'] = (string) substr(
627 627
                     $matches['attributes'],
628 628
                     $attribute[0][1] + strlen($attribute[0][0])
629 629
                 );
@@ -774,9 +774,9 @@  discard block
 block discarded – undo
774 774
         */
775 775
 
776 776
         if ($urlEncode) {
777
-            $nonDisplayables[] = '/%0[0-8bcef]/i';  // URL encoded 00-08, 11, 12, 14, 15
778
-            $nonDisplayables[] = '/%1[0-9a-f]/i';   // URL encoded 16-31
779
-            $nonDisplayables[] = '/%7f/i';      // URL encoded 127
777
+            $nonDisplayables[] = '/%0[0-8bcef]/i'; // URL encoded 00-08, 11, 12, 14, 15
778
+            $nonDisplayables[] = '/%1[0-9a-f]/i'; // URL encoded 16-31
779
+            $nonDisplayables[] = '/%7f/i'; // URL encoded 127
780 780
         }
781 781
 
782 782
         $nonDisplayables[] = '/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]+/S'; // 00-08, 11, 12, 14-31, 127
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -133,11 +133,11 @@
 block discarded – undo
133 133
     }
134 134
 
135 135
         /**
136
-     * The main function to clean input
137
-     * @param mixed $str
138
-     * @param bool $isImage
139
-     * @return mixed
140
-     */
136
+         * The main function to clean input
137
+         * @param mixed $str
138
+         * @param bool $isImage
139
+         * @return mixed
140
+         */
141 141
     public function clean(mixed $str, bool $isImage = false): mixed
142 142
     {
143 143
         if (is_array($str)) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
  * @class InputClean
54 54
  * @package Platine\Framework\Http
55 55
  */
56
-class InputClean
57
-{
56
+class InputClean {
58 57
     /**
59 58
      * The list of invalid filename chars
60 59
      * @var array<string>
@@ -127,8 +126,7 @@  discard block
 block discarded – undo
127 126
      * Create new instance
128 127
      * @param string $charset
129 128
      */
130
-    public function __construct(string $charset = 'UTF-8')
131
-    {
129
+    public function __construct(string $charset = 'UTF-8') {
132 130
         $this->charset = $charset;
133 131
     }
134 132
 
Please login to merge, or discard this patch.
src/Security/OTP/TOTP.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@  discard block
 block discarded – undo
52 52
  * @class TOTP
53 53
  * @package Platine\Framework\Security\OTP
54 54
  */
55
-class TOTP
56
-{
55
+class TOTP {
57 56
     /**
58 57
      * The length of the secret
59 58
      * @var int
@@ -82,8 +81,7 @@  discard block
 block discarded – undo
82 81
      * Create new instance
83 82
      * @param string|null $secret
84 83
      */
85
-    public function __construct(?string $secret = null)
86
-    {
84
+    public function __construct(?string $secret = null) {
87 85
         if ($secret === null) {
88 86
             $secret = $this->generateSecret();
89 87
         }
Please login to merge, or discard this patch.
src/OAuth2/Middleware/OAuthResourceMiddleware.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@
 block discarded – undo
120 120
      */
121 121
     protected function shouldBeProcessed(ServerRequestInterface $request): bool
122 122
     {
123
-       //If no route has been match no need check
123
+        //If no route has been match no need check
124 124
         /** @var Route|null $route */
125 125
         $route = $request->getAttribute(Route::class);
126 126
         if ($route === null) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,8 +49,7 @@
 block discarded – undo
49 49
  * @package Platine\Framework\OAuth2\Middleware
50 50
  * @template T
51 51
  */
52
-class OAuthResourceMiddleware implements MiddlewareInterface
53
-{
52
+class OAuthResourceMiddleware implements MiddlewareInterface {
54 53
     /**
55 54
      * The scope list
56 55
      * @var array<string>
Please login to merge, or discard this patch.
src/Console/PasswordGenerateCommand.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
  * @class PasswordGenerateCommand
57 57
  * @package Platine\Framework\Console
58 58
  */
59
-class PasswordGenerateCommand extends Command
60
-{
59
+class PasswordGenerateCommand extends Command {
61 60
     /**
62 61
      * The Hash instance
63 62
      * @var HashInterface
@@ -74,8 +73,7 @@  discard block
 block discarded – undo
74 73
      * Create new instance
75 74
      * @param HashInterface $hash
76 75
      */
77
-    public function __construct(HashInterface $hash)
78
-    {
76
+    public function __construct(HashInterface $hash) {
79 77
         parent::__construct('password:generate', 'Command to generate password');
80 78
         $this->hash = $hash;
81 79
 
Please login to merge, or discard this patch.
src/Console/Command/VendorPublishCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
  * @package Platine\Framework\Console\Command
62 62
  * @template T
63 63
  */
64
-class VendorPublishCommand extends Command
65
-{
64
+class VendorPublishCommand extends Command {
66 65
     /**
67 66
      * The vendor path
68 67
      * @var string
Please login to merge, or discard this patch.
src/Console/Command/MaintenanceCommand.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
 
74 74
         $this->setName('maintenance')
75
-             ->setDescription('Command to manage application maintenance');
75
+                ->setDescription('Command to manage application maintenance');
76 76
 
77 77
         $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function ($val) {
78 78
             if (!in_array($val, ['up', 'down', 'status'])) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 ));
83 83
             }
84 84
 
85
-             return $val;
85
+                return $val;
86 86
         });
87 87
 
88 88
         $this->addOption(
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $this->setName('maintenance')
75 75
              ->setDescription('Command to manage application maintenance');
76 76
 
77
-        $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function ($val) {
77
+        $this->addArgument('type', 'type of action [up|down|status]', 'status', true, false, function($val) {
78 78
             if (!in_array($val, ['up', 'down', 'status'])) {
79 79
                 throw new RuntimeException(sprintf(
80 80
                     'Invalid argument type [%s], must be one of [up, down, status]',
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             3600,
99 99
             false,
100 100
             false,
101
-            function ($val) {
101
+            function($val) {
102 102
                 if (strlen($val) > 0 && (!is_numeric($val) || (int) $val <= 0)) {
103 103
                     throw new RuntimeException(sprintf(
104 104
                         'Invalid retry value [%s], must be an integer greather than zero',
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             3600,
116 116
             false,
117 117
             false,
118
-            function ($val) {
118
+            function($val) {
119 119
                 if (strlen($val) > 0 && (!is_numeric($val) || (int) $val <= 0)) {
120 120
                     throw new RuntimeException(sprintf(
121 121
                         'Invalid refresh value [%s], must be an integer greather than zero',
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
             503,
140 140
             false,
141 141
             false,
142
-            function ($val) {
142
+            function($val) {
143 143
                 if (strlen($val) > 0 && (!is_numeric($val) || (int) $val < 200 || (int) $val > 505)) {
144 144
                     throw new RuntimeException(sprintf(
145 145
                         'Invalid HTTP status value [%s], must be between 200 and 505',
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
  * @package Platine\Framework\Console\Command
59 59
  * @template T
60 60
  */
61
-class MaintenanceCommand extends Command
62
-{
61
+class MaintenanceCommand extends Command {
63 62
     /**
64 63
      * Create new instance
65 64
      * @param Application $application
Please login to merge, or discard this patch.
src/Console/Command/ConfigCommand.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -56,14 +56,12 @@
 block discarded – undo
56 56
  * @package Platine\Framework\Console\Command
57 57
  * @template T
58 58
  */
59
-class ConfigCommand extends Command
60
-{
59
+class ConfigCommand extends Command {
61 60
     /**
62 61
      * Create new instance
63 62
      * @param Config<T> $config
64 63
      */
65
-    public function __construct(protected Config $config)
66
-    {
64
+    public function __construct(protected Config $config) {
67 65
         parent::__construct('config', 'Command to manage configuration');
68 66
 
69 67
         $this->addOption('-l|--list', 'List the configuration', '', false);
Please login to merge, or discard this patch.
src/Console/Command/RouteCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
  * @package Platine\Framework\Console\Command
62 62
  * @template T
63 63
  */
64
-class RouteCommand extends Command
65
-{
64
+class RouteCommand extends Command {
66 65
     /**
67 66
      * Create new instance
68 67
      * @param Application $application
Please login to merge, or discard this patch.
src/Console/MakeCommand.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@
 block discarded – undo
56 56
  * @class MakeCommand
57 57
  * @package Platine\Framework\Console
58 58
  */
59
-abstract class MakeCommand extends BaseCommand
60
-{
59
+abstract class MakeCommand extends BaseCommand {
61 60
     /**
62 61
      * The type of class
63 62
      * @var string
Please login to merge, or discard this patch.