Passed
Push — develop ( 562414...03bc90 )
by nguereza
03:20 queued 12s
created
src/Auth/Entity/Token.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
54 54
  * @class Token
55 55
  * @package Platine\Framework\Auth\Entity
56 56
  */
57
-class Token extends Entity
58
-{
57
+class Token extends Entity {
59 58
 
60 59
     /**
61 60
      * {@inheritdoc}
Please login to merge, or discard this patch.
src/Auth/Authentication/JWTAuthentication.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     public function getUser(): IdentityInterface
140 140
     {
141 141
         //if (!$this->isLogged()) {
142
-           // throw new AccountNotFoundException('User not logged', 401);
142
+            // throw new AccountNotFoundException('User not logged', 401);
143 143
         //}
144 144
 
145 145
         // $id = $this->session->get('user.id');
@@ -234,11 +234,11 @@  discard block
 block discarded – undo
234 234
         $expire = $this->config->get('api.auth.token_expire', 900);
235 235
         $tokenExpire = time() + $expire;
236 236
         $this->jwt->setSecret($secret)
237
-                  ->setPayload([
238
-                      'sub' => $user->id,
239
-                      'exp' => $tokenExpire,
240
-                  ])
241
-                  ->sign();
237
+                    ->setPayload([
238
+                        'sub' => $user->id,
239
+                        'exp' => $tokenExpire,
240
+                    ])
241
+                    ->sign();
242 242
         $refreshToken = Str::randomToken(24);
243 243
         $jwtToken = $this->jwt->getToken();
244 244
 
@@ -252,15 +252,15 @@  discard block
 block discarded – undo
252 252
         $this->tokenRepository->save($token);
253 253
 
254 254
         $data = [
255
-          'user' => [
255
+            'user' => [
256 256
             'id' => $user->id,
257 257
             'username' => $user->username,
258 258
             'lastname' => $user->lastname,
259 259
             'firstname' => $user->firstname,
260 260
             'permissions' => array_unique($permissions),
261
-          ],
262
-          'token' => $jwtToken,
263
-          'refresh_token' => $refreshToken,
261
+            ],
262
+            'token' => $jwtToken,
263
+            'refresh_token' => $refreshToken,
264 264
         ];
265 265
 
266 266
         return $data;
Please login to merge, or discard this patch.
src/Auth/Repository/TokenRepository.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,15 +55,13 @@
 block discarded – undo
55 55
  * @class TokenRepository
56 56
  * @package Platine\Framework\Auth\Repository
57 57
  */
58
-class TokenRepository extends Repository
59
-{
58
+class TokenRepository extends Repository {
60 59
 
61 60
     /**
62 61
      * Create new instance
63 62
      * @param EntityManager $manager
64 63
      */
65
-    public function __construct(EntityManager $manager)
66
-    {
64
+    public function __construct(EntityManager $manager) {
67 65
         parent::__construct($manager, Token::class);
68 66
     }
69 67
 }
Please login to merge, or discard this patch.