Passed
Push — develop ( e3e306...5da5fd )
by nguereza
04:19 queued 01:01
created
src/Auth/Middleware/ApiAuthenticationMiddleware.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\Auth\Middleware
62 62
  * @template T
63 63
  */
64
-class ApiAuthenticationMiddleware implements MiddlewareInterface
65
-{
64
+class ApiAuthenticationMiddleware implements MiddlewareInterface {
66 65
     /**
67 66
      * The Authentication instance
68 67
      * @var ApiAuthenticationInterface
Please login to merge, or discard this patch.
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
@@ -248,12 +248,12 @@  discard block
 block discarded – undo
248 248
         $tokenExpire = time() + $expire;
249 249
         $refreshTokenExpire = time() + $refreshExpire;
250 250
         $this->jwt->setSecret($secret)
251
-                  ->setPayload([
252
-                      'sub' => $user->id,
253
-                      'exp' => $tokenExpire,
254
-                      'permissions' => $permissions,
255
-                  ])
256
-                  ->sign();
251
+                    ->setPayload([
252
+                        'sub' => $user->id,
253
+                        'exp' => $tokenExpire,
254
+                        'permissions' => $permissions,
255
+                    ])
256
+                    ->sign();
257 257
         $refreshToken = bin2hex(random_bytes(20));
258 258
         $jwtToken = $this->jwt->getToken();
259 259
 
@@ -267,16 +267,16 @@  discard block
 block discarded – undo
267 267
         $this->tokenRepository->save($token);
268 268
 
269 269
         $data = [
270
-          'user' => [
270
+            'user' => [
271 271
             'id' => $user->id,
272 272
             'username' => $user->username,
273 273
             'lastname' => $user->lastname,
274 274
             'firstname' => $user->firstname,
275 275
             'email' => $user->email,
276 276
             'permissions' => $permissions,
277
-          ],
278
-          'token' => $jwtToken,
279
-          'refresh_token' => $refreshToken,
277
+            ],
278
+            'token' => $jwtToken,
279
+            'refresh_token' => $refreshToken,
280 280
         ];
281 281
 
282 282
         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.