@@ -139,11 +139,11 @@ |
||
139 | 139 | */ |
140 | 140 | protected function registerDefaultParsers(): void |
141 | 141 | { |
142 | - $this->registerParser('application/json', static function ($body) { |
|
142 | + $this->registerParser('application/json', static function($body) { |
|
143 | 143 | return Json::decode($body, true); |
144 | 144 | }); |
145 | 145 | |
146 | - $this->registerParser('application/x-www-form-urlencoded', static function ($body) { |
|
146 | + $this->registerParser('application/x-www-form-urlencoded', static function($body) { |
|
147 | 147 | $data = []; |
148 | 148 | parse_str($body, $data); |
149 | 149 |
@@ -164,7 +164,7 @@ |
||
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 = explode('+', $contentType); |
169 | 169 | |
170 | 170 | if (count($parts) >= 2) { |
@@ -58,8 +58,7 @@ discard block |
||
58 | 58 | * @class BodyParserMiddleware |
59 | 59 | * @package Platine\Framework\Http\Middleware |
60 | 60 | */ |
61 | -class BodyParserMiddleware implements MiddlewareInterface |
|
62 | -{ |
|
61 | +class BodyParserMiddleware implements MiddlewareInterface { |
|
63 | 62 | /** |
64 | 63 | * List of body parser to use |
65 | 64 | * @var array<string, callable> |
@@ -69,8 +68,7 @@ discard block |
||
69 | 68 | /** |
70 | 69 | * Create new instance |
71 | 70 | */ |
72 | - public function __construct() |
|
73 | - { |
|
71 | + public function __construct() { |
|
74 | 72 | $this->registerDefaultParsers(); |
75 | 73 | } |
76 | 74 | |
@@ -155,8 +153,7 @@ discard block |
||
155 | 153 | * @param ServerRequestInterface $request |
156 | 154 | * @return null|array<mixed>|object |
157 | 155 | */ |
158 | - protected function parseBody(ServerRequestInterface $request) |
|
159 | - { |
|
156 | + protected function parseBody(ServerRequestInterface $request) { |
|
160 | 157 | $contentType = $this->getRequestContentType($request); |
161 | 158 | if ($contentType === null) { |
162 | 159 | return null; |
@@ -183,7 +183,7 @@ |
||
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) { |
@@ -65,8 +65,7 @@ |
||
65 | 65 | * @package Platine\Framework\Http\Middleware |
66 | 66 | * @template T |
67 | 67 | */ |
68 | -class CsrfMiddleware implements MiddlewareInterface |
|
69 | -{ |
|
68 | +class CsrfMiddleware implements MiddlewareInterface { |
|
70 | 69 | /** |
71 | 70 | * The configuration instance |
72 | 71 | * @var Config<T> |
@@ -39,6 +39,5 @@ |
||
39 | 39 | * @class JWTException |
40 | 40 | * @package Platine\Framework\Security\JWT\Exception |
41 | 41 | */ |
42 | -class JWTException extends Exception |
|
43 | -{ |
|
42 | +class JWTException extends Exception { |
|
44 | 43 | } |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class InvalidAlgorithmException |
38 | 38 | * @package Platine\Framework\Security\JWT\Exception |
39 | 39 | */ |
40 | -class InvalidAlgorithmException extends JWTException |
|
41 | -{ |
|
40 | +class InvalidAlgorithmException extends JWTException { |
|
42 | 41 | } |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class TokenExpiredException |
38 | 38 | * @package Platine\Framework\Security\JWT\Exception |
39 | 39 | */ |
40 | -class TokenExpiredException extends JWTException |
|
41 | -{ |
|
40 | +class TokenExpiredException extends JWTException { |
|
42 | 41 | } |
@@ -37,6 +37,5 @@ |
||
37 | 37 | * @class InvalidTokenException |
38 | 38 | * @package Platine\Framework\Security\JWT\Exception |
39 | 39 | */ |
40 | -class InvalidTokenException extends JWTException |
|
41 | -{ |
|
40 | +class InvalidTokenException extends JWTException { |
|
42 | 41 | } |
@@ -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 | * The payload |
64 | 63 | * @var array<string, mixed> |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | public function register(): void |
71 | 71 | { |
72 | - $this->app->bind(Configuration::class, function (ContainerInterface $app) { |
|
72 | + $this->app->bind(Configuration::class, function(ContainerInterface $app) { |
|
73 | 73 | return new Configuration($app->get(Config::class)->get('lang', [])); |
74 | 74 | }); |
75 | 75 | $this->app->share(StorageInterface::class, MemoryStorage::class); |
@@ -61,8 +61,7 @@ |
||
61 | 61 | * @class LangServiceProvider |
62 | 62 | * @package Platine\Framework\Service\Provider |
63 | 63 | */ |
64 | -class LangServiceProvider extends ServiceProvider |
|
65 | -{ |
|
64 | +class LangServiceProvider extends ServiceProvider { |
|
66 | 65 | /** |
67 | 66 | * {@inheritdoc} |
68 | 67 | */ |
@@ -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 | } |