@@ -62,8 +62,7 @@ |
||
| 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 | * Create new instance |
| 69 | 68 | * @param AuthorizationInterface $authorization |
@@ -62,8 +62,7 @@ |
||
| 62 | 62 | * @package Platine\Framework\Auth\Middleware |
| 63 | 63 | * @template T |
| 64 | 64 | */ |
| 65 | -class AuthenticationMiddleware implements MiddlewareInterface |
|
| 66 | -{ |
|
| 65 | +class AuthenticationMiddleware implements MiddlewareInterface { |
|
| 67 | 66 | /** |
| 68 | 67 | * Create new instance |
| 69 | 68 | * @param AuthenticationInterface $authentication |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | * @class AbstractValidator |
| 54 | 54 | * @package Platine\Framework\Form\Validator |
| 55 | 55 | */ |
| 56 | -abstract class AbstractValidator extends Validator |
|
| 57 | -{ |
|
| 56 | +abstract class AbstractValidator extends Validator { |
|
| 58 | 57 | /** |
| 59 | 58 | * {@inheritdoc} |
| 60 | 59 | * @return bool |
@@ -54,8 +54,7 @@ discard block |
||
| 54 | 54 | * @class RequestData |
| 55 | 55 | * @package Platine\Framework\Http |
| 56 | 56 | */ |
| 57 | -class RequestData |
|
| 58 | -{ |
|
| 57 | +class RequestData { |
|
| 59 | 58 | /** |
| 60 | 59 | * The request body or post data |
| 61 | 60 | * @var array<string, mixed> |
@@ -96,8 +95,7 @@ discard block |
||
| 96 | 95 | * Create new instance |
| 97 | 96 | * @param ServerRequestInterface $request |
| 98 | 97 | */ |
| 99 | - public function __construct(ServerRequestInterface $request) |
|
| 100 | - { |
|
| 98 | + public function __construct(ServerRequestInterface $request) { |
|
| 101 | 99 | $this->posts = (array) $request->getParsedBody(); |
| 102 | 100 | $this->gets = $request->getQueryParams(); |
| 103 | 101 | $this->servers = $request->getServerParams(); |
@@ -55,14 +55,12 @@ |
||
| 55 | 55 | * @class RouteHelper |
| 56 | 56 | * @package Platine\Framework\Http |
| 57 | 57 | */ |
| 58 | -class RouteHelper |
|
| 59 | -{ |
|
| 58 | +class RouteHelper { |
|
| 60 | 59 | /** |
| 61 | 60 | * Create new instance |
| 62 | 61 | * @param Router $router |
| 63 | 62 | */ |
| 64 | - public function __construct(protected Router $router) |
|
| 65 | - { |
|
| 63 | + public function __construct(protected Router $router) { |
|
| 66 | 64 | } |
| 67 | 65 | |
| 68 | 66 | /** |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | */ |
| 124 | 124 | protected function shouldBeProcessed(ServerRequestInterface $request): bool |
| 125 | 125 | { |
| 126 | - //If no route has been match no need check for CSRF |
|
| 126 | + //If no route has been match no need check for CSRF |
|
| 127 | 127 | /** @var Route|null $route */ |
| 128 | 128 | $route = $request->getAttribute(Route::class); |
| 129 | 129 | if ($route === null) { |
@@ -64,8 +64,7 @@ |
||
| 64 | 64 | * @package Platine\Framework\Http\Middleware |
| 65 | 65 | * @template T |
| 66 | 66 | */ |
| 67 | -class CsrfMiddleware implements MiddlewareInterface |
|
| 68 | -{ |
|
| 67 | +class CsrfMiddleware implements MiddlewareInterface { |
|
| 69 | 68 | /** |
| 70 | 69 | * The request instance to use |
| 71 | 70 | * @var ServerRequestInterface |
@@ -59,14 +59,12 @@ |
||
| 59 | 59 | * @package Platine\Framework\Http\Middleware |
| 60 | 60 | * @template T |
| 61 | 61 | */ |
| 62 | -class SecurityPolicyMiddleware implements MiddlewareInterface |
|
| 63 | -{ |
|
| 62 | +class SecurityPolicyMiddleware implements MiddlewareInterface { |
|
| 64 | 63 | /** |
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param SecurityPolicy<T> $securityPolicy |
| 67 | 66 | */ |
| 68 | - public function __construct(protected SecurityPolicy $securityPolicy) |
|
| 69 | - { |
|
| 67 | + public function __construct(protected SecurityPolicy $securityPolicy) { |
|
| 70 | 68 | } |
| 71 | 69 | |
| 72 | 70 | /** |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | */ |
| 124 | 124 | protected function shouldBeProcessed(ServerRequestInterface $request): bool |
| 125 | 125 | { |
| 126 | - //If no route has been match no need check for CSRF |
|
| 126 | + //If no route has been match no need check for CSRF |
|
| 127 | 127 | /** @var Route|null $route */ |
| 128 | 128 | $route = $request->getAttribute(Route::class); |
| 129 | 129 | if ($route === null) { |
@@ -59,14 +59,12 @@ |
||
| 59 | 59 | * @class RouteDispatcherMiddleware |
| 60 | 60 | * @package Platine\Framework\Http\Middleware |
| 61 | 61 | */ |
| 62 | -class RouteDispatcherMiddleware implements MiddlewareInterface |
|
| 63 | -{ |
|
| 62 | +class RouteDispatcherMiddleware implements MiddlewareInterface { |
|
| 64 | 63 | /** |
| 65 | 64 | * Create new instance |
| 66 | 65 | * @param MiddlewareResolverInterface $resolver |
| 67 | 66 | */ |
| 68 | - public function __construct(protected MiddlewareResolverInterface $resolver) |
|
| 69 | - { |
|
| 67 | + public function __construct(protected MiddlewareResolverInterface $resolver) { |
|
| 70 | 68 | } |
| 71 | 69 | |
| 72 | 70 | /** |
@@ -71,9 +71,9 @@ discard block |
||
| 71 | 71 | class CrudAction |
| 72 | 72 | { |
| 73 | 73 | /** |
| 74 | - * The Repository instance |
|
| 75 | - * @var Repository<TEntity> |
|
| 76 | - */ |
|
| 74 | + * The Repository instance |
|
| 75 | + * @var Repository<TEntity> |
|
| 76 | + */ |
|
| 77 | 77 | protected Repository $repository; |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -161,14 +161,14 @@ discard block |
||
| 161 | 161 | protected string $validatorClass; |
| 162 | 162 | |
| 163 | 163 | /** |
| 164 | - * Create new instance |
|
| 165 | - * @param Lang $lang |
|
| 166 | - * @param Pagination $pagination |
|
| 167 | - * @param Template $template |
|
| 168 | - * @param Flash $flash |
|
| 169 | - * @param RouteHelper $routeHelper |
|
| 170 | - * @param LoggerInterface $logger |
|
| 171 | - */ |
|
| 164 | + * Create new instance |
|
| 165 | + * @param Lang $lang |
|
| 166 | + * @param Pagination $pagination |
|
| 167 | + * @param Template $template |
|
| 168 | + * @param Flash $flash |
|
| 169 | + * @param RouteHelper $routeHelper |
|
| 170 | + * @param LoggerInterface $logger |
|
| 171 | + */ |
|
| 172 | 172 | public function __construct( |
| 173 | 173 | protected Lang $lang, |
| 174 | 174 | protected Pagination $pagination, |
@@ -180,10 +180,10 @@ discard block |
||
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | /** |
| 183 | - * List all entities |
|
| 184 | - * @param ServerRequestInterface $request |
|
| 185 | - * @return ResponseInterface |
|
| 186 | - */ |
|
| 183 | + * List all entities |
|
| 184 | + * @param ServerRequestInterface $request |
|
| 185 | + * @return ResponseInterface |
|
| 186 | + */ |
|
| 187 | 187 | public function index(ServerRequestInterface $request): ResponseInterface |
| 188 | 188 | { |
| 189 | 189 | $context = $this->getTemplateData(); |
@@ -195,14 +195,14 @@ discard block |
||
| 195 | 195 | $currentPage = (int) $param->get('page', 1); |
| 196 | 196 | |
| 197 | 197 | $this->pagination->setTotalItems($totalItems) |
| 198 | - ->setCurrentPage($currentPage); |
|
| 198 | + ->setCurrentPage($currentPage); |
|
| 199 | 199 | |
| 200 | 200 | $limit = $this->pagination->getItemsPerPage(); |
| 201 | 201 | $offset = $this->pagination->getOffset(); |
| 202 | 202 | |
| 203 | 203 | $query = $this->repository->query(); |
| 204 | 204 | $query->offset($offset) |
| 205 | - ->limit($limit); |
|
| 205 | + ->limit($limit); |
|
| 206 | 206 | |
| 207 | 207 | if (count($this->orderFields) > 0) { |
| 208 | 208 | foreach ($this->orderFields as $field => $dir) { |
@@ -227,10 +227,10 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | /** |
| 230 | - * List entity detail |
|
| 231 | - * @param ServerRequestInterface $request |
|
| 232 | - * @return ResponseInterface |
|
| 233 | - */ |
|
| 230 | + * List entity detail |
|
| 231 | + * @param ServerRequestInterface $request |
|
| 232 | + * @return ResponseInterface |
|
| 233 | + */ |
|
| 234 | 234 | public function detail(ServerRequestInterface $request): ResponseInterface |
| 235 | 235 | { |
| 236 | 236 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -258,10 +258,10 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
| 261 | - * Create new entity |
|
| 262 | - * @param ServerRequestInterface $request |
|
| 263 | - * @return ResponseInterface |
|
| 264 | - */ |
|
| 261 | + * Create new entity |
|
| 262 | + * @param ServerRequestInterface $request |
|
| 263 | + * @return ResponseInterface |
|
| 264 | + */ |
|
| 265 | 265 | public function create(ServerRequestInterface $request): ResponseInterface |
| 266 | 266 | { |
| 267 | 267 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -334,10 +334,10 @@ discard block |
||
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | /** |
| 337 | - * Update existing entity |
|
| 338 | - * @param ServerRequestInterface $request |
|
| 339 | - * @return ResponseInterface |
|
| 340 | - */ |
|
| 337 | + * Update existing entity |
|
| 338 | + * @param ServerRequestInterface $request |
|
| 339 | + * @return ResponseInterface |
|
| 340 | + */ |
|
| 341 | 341 | public function update(ServerRequestInterface $request): ResponseInterface |
| 342 | 342 | { |
| 343 | 343 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -422,10 +422,10 @@ discard block |
||
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | /** |
| 425 | - * Delete the entity |
|
| 426 | - * @param ServerRequestInterface $request |
|
| 427 | - * @return ResponseInterface |
|
| 428 | - */ |
|
| 425 | + * Delete the entity |
|
| 426 | + * @param ServerRequestInterface $request |
|
| 427 | + * @return ResponseInterface |
|
| 428 | + */ |
|
| 429 | 429 | public function delete(ServerRequestInterface $request): ResponseInterface |
| 430 | 430 | { |
| 431 | 431 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * @package Platine\Framework\Http\Action |
| 69 | 69 | * @template TEntity as \Platine\Orm\Entity |
| 70 | 70 | */ |
| 71 | -class CrudAction |
|
| 72 | -{ |
|
| 71 | +class CrudAction { |
|
| 73 | 72 | /** |
| 74 | 73 | * The Repository instance |
| 75 | 74 | * @var Repository<TEntity> |