@@ -71,7 +71,7 @@ |
||
| 71 | 71 | 'updated_at' => '?date', |
| 72 | 72 | ]); |
| 73 | 73 | |
| 74 | - $mapper->filter('status', function (Query $q, $status) { |
|
| 74 | + $mapper->filter('status', function(Query $q, $status) { |
|
| 75 | 75 | $q->where('status')->is($status); |
| 76 | 76 | }); |
| 77 | 77 | } |
@@ -57,8 +57,7 @@ |
||
| 57 | 57 | * @package Platine\Framework\Auth\Entity |
| 58 | 58 | * @extends Entity<User> |
| 59 | 59 | */ |
| 60 | -class User extends Entity implements IdentityInterface |
|
| 61 | -{ |
|
| 60 | +class User extends Entity implements IdentityInterface { |
|
| 62 | 61 | /** |
| 63 | 62 | * |
| 64 | 63 | * @param EntityMapperInterface<User> $mapper |
@@ -79,8 +79,8 @@ |
||
| 79 | 79 | foreach ($pages as $page) { |
| 80 | 80 | if ($page->getUrl() !== null) { |
| 81 | 81 | $html .= '<li class = "page-item' . ($page->isCurrent() ? ' active"' : '"') |
| 82 | - . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
| 83 | - . $page->getNumber() . '</a></li>'; |
|
| 82 | + . '><a href = "' . $page->getUrl() . '" class="page-link">' |
|
| 83 | + . $page->getNumber() . '</a></li>'; |
|
| 84 | 84 | } else { |
| 85 | 85 | $html .= '<li class = "page-item disabled"><a href="#" class="page-link">' |
| 86 | 86 | . $page->getNumber() . '</a></li>'; |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class BootstrapRenderer |
| 55 | 55 | * @package Platine\Framework\Pagination |
| 56 | 56 | */ |
| 57 | -class BootstrapRenderer implements RendererInterface |
|
| 58 | -{ |
|
| 57 | +class BootstrapRenderer implements RendererInterface { |
|
| 59 | 58 | /** |
| 60 | 59 | * {@inheritdoc} |
| 61 | 60 | */ |
@@ -55,16 +55,14 @@ |
||
| 55 | 55 | * @class FileResponse |
| 56 | 56 | * @package Platine\Framework\Http\Response |
| 57 | 57 | */ |
| 58 | -class FileResponse extends Response |
|
| 59 | -{ |
|
| 58 | +class FileResponse extends Response { |
|
| 60 | 59 | |
| 61 | 60 | /** |
| 62 | 61 | * Create new instance |
| 63 | 62 | * @param string $path |
| 64 | 63 | * @param string|null $filename |
| 65 | 64 | */ |
| 66 | - public function __construct(string $path, ?string $filename = null) |
|
| 67 | - { |
|
| 65 | + public function __construct(string $path, ?string $filename = null) { |
|
| 68 | 66 | parent::__construct(200); |
| 69 | 67 | |
| 70 | 68 | $realpath = Path::realPath($path); |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | |
| 83 | 83 | $this->headers['content-description'] = ['File Transfer']; |
| 84 | 84 | $this->headers['content-type'] = [$mimetype]; |
| 85 | - $this->headers['content-disposition'] = ['attachment; filename="' . $filename . '"']; |
|
| 85 | + $this->headers['content-disposition'] = ['attachment; filename="' . $filename . '"']; |
|
| 86 | 86 | $this->headers['expires'] = ['0']; |
| 87 | 87 | $this->headers['cache-control'] = ['must-revalidate']; |
| 88 | 88 | $this->headers['pragma'] = ['public']; |
@@ -162,14 +162,14 @@ |
||
| 162 | 162 | { |
| 163 | 163 | if ($this->isPreflight()) { |
| 164 | 164 | $this->setOrigin() |
| 165 | - ->setMaxAge() |
|
| 166 | - ->setAllowCredentials() |
|
| 167 | - ->setAllowMethods() |
|
| 168 | - ->setAllowHeaders(); |
|
| 165 | + ->setMaxAge() |
|
| 166 | + ->setAllowCredentials() |
|
| 167 | + ->setAllowMethods() |
|
| 168 | + ->setAllowHeaders(); |
|
| 169 | 169 | } else { |
| 170 | 170 | $this->setOrigin() |
| 171 | - ->setExposedHeaders() |
|
| 172 | - ->setAllowCredentials(); |
|
| 171 | + ->setExposedHeaders() |
|
| 172 | + ->setAllowCredentials(); |
|
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | |
@@ -62,8 +62,7 @@ |
||
| 62 | 62 | * @package Platine\Framework\Http\Middleware |
| 63 | 63 | * @template T |
| 64 | 64 | */ |
| 65 | -class CorsMiddleware implements MiddlewareInterface |
|
| 66 | -{ |
|
| 65 | +class CorsMiddleware implements MiddlewareInterface { |
|
| 67 | 66 | /** |
| 68 | 67 | * The server request to use |
| 69 | 68 | * @var ServerRequestInterface |
@@ -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 | } |
@@ -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) { |
@@ -138,11 +138,11 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | protected function registerDefaultParsers(): void |
| 140 | 140 | { |
| 141 | - $this->registerParser('application/json', static function ($body) { |
|
| 141 | + $this->registerParser('application/json', static function($body) { |
|
| 142 | 142 | return Json::decode($body, true); |
| 143 | 143 | }); |
| 144 | 144 | |
| 145 | - $this->registerParser('application/x-www-form-urlencoded', static function ($body) { |
|
| 145 | + $this->registerParser('application/x-www-form-urlencoded', static function($body) { |
|
| 146 | 146 | $data = []; |
| 147 | 147 | parse_str($body, $data); |
| 148 | 148 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @param ServerRequestInterface $request |
| 156 | 156 | * @return null|array<mixed>|object |
| 157 | 157 | */ |
| 158 | - protected function parseBody(ServerRequestInterface $request): array|object|null |
|
| 158 | + protected function parseBody(ServerRequestInterface $request): array | object | null |
|
| 159 | 159 | { |
| 160 | 160 | $contentType = $this->getRequestContentType($request); |
| 161 | 161 | if ($contentType === null) { |
@@ -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 | |