Passed
Push — develop ( 36c2b4...1d782e )
by nguereza
03:02
created
config/api.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
         'auth' => [
5 5
             'path' => '/api',
6 6
             'url_whitelist' => [
7
-               '/api/auth/login',
7
+                '/api/auth/login',
8 8
             ],
9 9
             'expire' => 3600,
10 10
             'headers' => [
Please login to merge, or discard this patch.
src/Http/Middleware/BodyParserMiddleware.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
         }
165 165
 
166 166
         if (!$this->hasParser($contentType)) {
167
-             // If not, look for a media type with a structured syntax suffix (RFC 6839)
167
+                // If not, look for a media type with a structured syntax suffix (RFC 6839)
168 168
             $parts = expldoe('+', $contentType);
169 169
 
170 170
             if (count($parts) >= 2) {
Please login to merge, or discard this patch.
src/Http/Middleware/CsrfMiddleware.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
      */
184 184
     protected function shouldBeProcessed(ServerRequestInterface $request): bool
185 185
     {
186
-       //If no route has been match no need check for CSRF
186
+        //If no route has been match no need check for CSRF
187 187
         /** @var ?Route $route */
188 188
         $route = $request->getAttribute(Route::class);
189 189
         if (!$route) {
Please login to merge, or discard this patch.
src/Security/JWT/JWT.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,8 +148,8 @@
 block discarded – undo
148 148
                     ));
149 149
                 } else {
150 150
                     $this->setHeaders($headers)
151
-                          ->setPayload($payload)
152
-                           ->setOriginalToken($token)
151
+                            ->setPayload($payload)
152
+                            ->setOriginalToken($token)
153 153
                             ->setEncodedSignature($parts[2]);
154 154
 
155 155
                     if (!$this->verify()) {
Please login to merge, or discard this patch.
src/Demo/API/Validator/LoginValidator.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -91,12 +91,12 @@
 block discarded – undo
91 91
     public function setValidationRules(): void
92 92
     {
93 93
         $this->addRules('username', [
94
-           new NotEmpty(),
95
-           new MinLength(3)
94
+            new NotEmpty(),
95
+            new MinLength(3)
96 96
         ]);
97 97
 
98 98
         $this->addRules('password', [
99
-           new NotEmpty(),
99
+            new NotEmpty(),
100 100
         ]);
101 101
     }
102 102
 }
Please login to merge, or discard this patch.
src/Auth/Authentication/JWTAuthentication.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     public function getUser(): IdentityInterface
129 129
     {
130 130
         //if (!$this->isLogged()) {
131
-           // throw new AccountNotFoundException('User not logged', 401);
131
+            // throw new AccountNotFoundException('User not logged', 401);
132 132
         //}
133 133
 
134 134
         // $id = $this->session->get('user.id');
@@ -223,23 +223,23 @@  discard block
 block discarded – undo
223 223
         $expire = $this->config->get('api.auth.expire', 1800);
224 224
         $tokenExpire = time() + $expire;
225 225
         $this->jwt->setSecret($secret)
226
-                  ->setPayload([
227
-                      'id' => $user->id,
228
-                      'exp' => $tokenExpire,
229
-                  ])
230
-                  ->sign();
226
+                    ->setPayload([
227
+                        'id' => $user->id,
228
+                        'exp' => $tokenExpire,
229
+                    ])
230
+                    ->sign();
231 231
 
232 232
         $data = [
233
-          'user' => [
233
+            'user' => [
234 234
             'id' => $user->id,
235 235
             'username' => $user->username,
236 236
             'lastname' => $user->lastname,
237 237
             'firstname' => $user->firstname,
238 238
             'permissions' => array_unique($permissions),
239
-          ],
240
-          'token' => $this->jwt->getToken(),
241
-          'refresh_token' => '',
242
-          'expire_at' => $tokenExpire,
239
+            ],
240
+            'token' => $this->jwt->getToken(),
241
+            'refresh_token' => '',
242
+            'expire_at' => $tokenExpire,
243 243
         ];
244 244
 
245 245
         return $data;
Please login to merge, or discard this patch.