Passed
Push — develop ( 089cb5...597d05 )
by nguereza
05:42
created
src/Auth/Middleware/AuthorizationMiddleware.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
  * @package Platine\Framework\Auth\Middleware
63 63
  * @template T
64 64
  */
65
-class AuthorizationMiddleware implements MiddlewareInterface
66
-{
65
+class AuthorizationMiddleware implements MiddlewareInterface {
67 66
     /**
68 67
      * The Authorization instance
69 68
      * @var AuthorizationInterface
Please login to merge, or discard this patch.
src/Auth/AuthorizationInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
  * @class AuthorizationInterface
52 52
  * @package Platine\Framework\Auth
53 53
  */
54
-interface AuthorizationInterface
55
-{
54
+interface AuthorizationInterface {
56 55
     /**
57 56
      * Check if user is granted the given permission
58 57
      * @param string $permission the permission to check
Please login to merge, or discard this patch.
src/Auth/Event/AuthInvalidPasswordEvent.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * @class AuthInvalidPasswordEvent
55 55
  * @package Platine\Framework\Auth\Event
56 56
  */
57
-class AuthInvalidPasswordEvent extends Event
58
-{
57
+class AuthInvalidPasswordEvent extends Event {
59 58
     /**
60 59
      * The authentication user
61 60
      * @var User
@@ -66,8 +65,7 @@  discard block
 block discarded – undo
66 65
      * Create new instance
67 66
      * @param User $user
68 67
      */
69
-    public function __construct(User $user)
70
-    {
68
+    public function __construct(User $user) {
71 69
         parent::__construct(__CLASS__, []);
72 70
         $this->user = $user;
73 71
     }
Please login to merge, or discard this patch.
src/Auth/AuthenticationInterface.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 AuthenticationInterface
57 57
  * @package Platine\Framework\Auth
58 58
  */
59
-interface AuthenticationInterface
60
-{
59
+interface AuthenticationInterface {
61 60
     /**
62 61
      * Authenticate the user
63 62
      * @param array<string, mixed> $credentials
Please login to merge, or discard this patch.
src/Auth/Authentication/JWTAuthentication.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@
 block discarded – undo
69 69
  * @package Platine\Framework\Auth\Authentication
70 70
  * @template T
71 71
  */
72
-class JWTAuthentication implements ApiAuthenticationInterface
73
-{
72
+class JWTAuthentication implements ApiAuthenticationInterface {
74 73
     /**
75 74
      * The JWT instance
76 75
      * @var JWT
Please login to merge, or discard this patch.
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -262,12 +262,12 @@  discard block
 block discarded – undo
262 262
         $tokenExpire = time() + $expire;
263 263
         $refreshTokenExpire = time() + $refreshExpire;
264 264
         $this->jwt->setSecret($secret)
265
-                  ->setPayload([
266
-                      'sub' => $user->id,
267
-                      'exp' => $tokenExpire,
268
-                      'permissions' => $permissions,
269
-                  ])
270
-                  ->sign();
265
+                    ->setPayload([
266
+                        'sub' => $user->id,
267
+                        'exp' => $tokenExpire,
268
+                        'permissions' => $permissions,
269
+                    ])
270
+                    ->sign();
271 271
 
272 272
         $refreshToken = Str::random(64);
273 273
         $jwtToken = $this->jwt->getToken();
@@ -282,16 +282,16 @@  discard block
 block discarded – undo
282 282
         $this->tokenRepository->save($token);
283 283
 
284 284
         $data = [
285
-          'user' => [
285
+            'user' => [
286 286
             'id' => $user->id,
287 287
             'username' => $user->username,
288 288
             'lastname' => $user->lastname,
289 289
             'firstname' => $user->firstname,
290 290
             'email' => $user->email,
291 291
             'permissions' => $permissions,
292
-          ],
293
-          'token' => $jwtToken,
294
-          'refresh_token' => $refreshToken,
292
+            ],
293
+            'token' => $jwtToken,
294
+            'refresh_token' => $refreshToken,
295 295
         ];
296 296
 
297 297
         return array_merge($data, $this->getUserData($user, $token));
Please login to merge, or discard this patch.
src/Auth/Authentication/SessionAuthentication.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@
 block discarded – undo
63 63
  * class SessionAuthentication
64 64
  * @package Platine\Framework\Auth\Authentication
65 65
  */
66
-class SessionAuthentication implements AuthenticationInterface
67
-{
66
+class SessionAuthentication implements AuthenticationInterface {
68 67
     /**
69 68
      * The session instance to use
70 69
      * @var Session
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -185,11 +185,11 @@
 block discarded – undo
185 185
         }
186 186
 
187 187
         $data = [
188
-          'id' => $user->id,
189
-          'username' => $user->username,
190
-          'lastname' => $user->lastname,
191
-          'firstname' => $user->firstname,
192
-          'permissions' => array_unique($permissions),
188
+            'id' => $user->id,
189
+            'username' => $user->username,
190
+            'lastname' => $user->lastname,
191
+            'firstname' => $user->firstname,
192
+            'permissions' => array_unique($permissions),
193 193
         ];
194 194
 
195 195
         $this->session->set('user', array_merge($data, $this->getUserData($user)));
Please login to merge, or discard this patch.
src/Auth/IdentityInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,8 +51,7 @@
 block discarded – undo
51 51
  * @class IdentityInterface
52 52
  * @package Platine\Framework\Auth
53 53
  */
54
-interface IdentityInterface
55
-{
54
+interface IdentityInterface {
56 55
     /**
57 56
      * Return the id of the current user
58 57
      * @return mixed
Please login to merge, or discard this patch.
src/Auth/Authorization/SessionAuthorization.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 SessionAuthorization
55 55
  * @package Platine\Framework\Auth\Authorization
56 56
  */
57
-class SessionAuthorization implements AuthorizationInterface
58
-{
57
+class SessionAuthorization implements AuthorizationInterface {
59 58
     /**
60 59
      * The session instance to use
61 60
      * @var Session
Please login to merge, or discard this patch.
src/Auth/ApiAuthenticationInterface.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
  * @class ApiAuthenticationInterface
58 58
  * @package Platine\Framework\Auth
59 59
  */
60
-interface ApiAuthenticationInterface
61
-{
60
+interface ApiAuthenticationInterface {
62 61
     /**
63 62
      * Whether the request is authenticated
64 63
      * @param ServerRequestInterface $request
Please login to merge, or discard this patch.