@@ -148,8 +148,8 @@ |
||
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()) { |
@@ -57,8 +57,7 @@ |
||
57 | 57 | * @class JWT |
58 | 58 | * @package Platine\Framework\Security\JWT |
59 | 59 | */ |
60 | -class JWT |
|
61 | -{ |
|
60 | +class JWT { |
|
62 | 61 | |
63 | 62 | /** |
64 | 63 | * The payload |
@@ -51,8 +51,7 @@ |
||
51 | 51 | * @class EncoderInterface |
52 | 52 | * @package Platine\Framework\Security\JWT |
53 | 53 | */ |
54 | -interface EncoderInterface |
|
55 | -{ |
|
54 | +interface EncoderInterface { |
|
56 | 55 | |
57 | 56 | /** |
58 | 57 | * Encode the given data |
@@ -61,8 +61,7 @@ |
||
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 | /** |
68 | 67 | * The Authentication instance |
@@ -67,8 +67,7 @@ |
||
67 | 67 | * @package Platine\Framework\Auth\Authentication |
68 | 68 | * @template T |
69 | 69 | */ |
70 | -class JWTAuthentication implements ApiAuthenticationInterface |
|
71 | -{ |
|
70 | +class JWTAuthentication implements ApiAuthenticationInterface { |
|
72 | 71 | |
73 | 72 | /** |
74 | 73 | * The JWT instance |
@@ -249,11 +249,11 @@ discard block |
||
249 | 249 | $tokenExpire = time() + $expire; |
250 | 250 | $refreshTokenExpire = time() + $refreshExpire; |
251 | 251 | $this->jwt->setSecret($secret) |
252 | - ->setPayload([ |
|
253 | - 'sub' => $user->id, |
|
254 | - 'exp' => $tokenExpire, |
|
255 | - ]) |
|
256 | - ->sign(); |
|
252 | + ->setPayload([ |
|
253 | + 'sub' => $user->id, |
|
254 | + 'exp' => $tokenExpire, |
|
255 | + ]) |
|
256 | + ->sign(); |
|
257 | 257 | $refreshToken = Str::randomToken(24); |
258 | 258 | $jwtToken = $this->jwt->getToken(); |
259 | 259 | |
@@ -267,16 +267,16 @@ discard block |
||
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 $data; |
@@ -53,8 +53,7 @@ |
||
53 | 53 | * @class ApiAuthenticationInterface |
54 | 54 | * @package Platine\Framework\Auth |
55 | 55 | */ |
56 | -interface ApiAuthenticationInterface |
|
57 | -{ |
|
56 | +interface ApiAuthenticationInterface { |
|
58 | 57 | |
59 | 58 | /** |
60 | 59 | * Whether the request is authenticated |
@@ -54,8 +54,7 @@ |
||
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} |
@@ -70,7 +70,7 @@ |
||
70 | 70 | 'updated_at' => '?date', |
71 | 71 | ]); |
72 | 72 | |
73 | - $mapper->filter('not_expire', function (Query $q, $date) { |
|
73 | + $mapper->filter('not_expire', function(Query $q, $date) { |
|
74 | 74 | $q->where('expire_at')->gt($date); |
75 | 75 | }); |
76 | 76 | } |
@@ -55,15 +55,13 @@ |
||
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 | } |
@@ -66,7 +66,7 @@ |
||
66 | 66 | */ |
67 | 67 | public function register(): void |
68 | 68 | { |
69 | - $this->app->bind(Dompdf::class, function (ContainerInterface $app) { |
|
69 | + $this->app->bind(Dompdf::class, function(ContainerInterface $app) { |
|
70 | 70 | $defaultOptions = array( |
71 | 71 | 'isRemoteEnabled' => true |
72 | 72 | ); |
@@ -58,8 +58,7 @@ |
||
58 | 58 | * @class PDFServiceProvider |
59 | 59 | * @package Platine\Framework\Service\Provider |
60 | 60 | */ |
61 | -class PDFServiceProvider extends ServiceProvider |
|
62 | -{ |
|
61 | +class PDFServiceProvider extends ServiceProvider { |
|
63 | 62 | |
64 | 63 | /** |
65 | 64 | * {@inheritdoc} |
@@ -54,8 +54,7 @@ |
||
54 | 54 | * @class TextPlainErrorRenderer |
55 | 55 | * @package Platine\Framework\Handler\Error\Renderer |
56 | 56 | */ |
57 | -class TextPlainErrorRenderer extends AbstractErrorRenderer |
|
58 | -{ |
|
57 | +class TextPlainErrorRenderer extends AbstractErrorRenderer { |
|
59 | 58 | |
60 | 59 | /** |
61 | 60 | * {@inheritdoc} |