@@ -65,8 +65,7 @@ |
||
| 65 | 65 | * @class MakeResourceActionCommand |
| 66 | 66 | * @package Platine\Framework\Console\Command |
| 67 | 67 | */ |
| 68 | -class MakeResourceActionCommand extends MakeCommand |
|
| 69 | -{ |
|
| 68 | +class MakeResourceActionCommand extends MakeCommand { |
|
| 70 | 69 | /** |
| 71 | 70 | * {@inheritdoc} |
| 72 | 71 | */ |
@@ -72,45 +72,45 @@ discard block |
||
| 72 | 72 | class CrudAction |
| 73 | 73 | { |
| 74 | 74 | /** |
| 75 | - * The Lang instance |
|
| 76 | - * @var Lang |
|
| 77 | - */ |
|
| 75 | + * The Lang instance |
|
| 76 | + * @var Lang |
|
| 77 | + */ |
|
| 78 | 78 | protected Lang $lang; |
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | - * The Pagination instance |
|
| 82 | - * @var Pagination |
|
| 83 | - */ |
|
| 81 | + * The Pagination instance |
|
| 82 | + * @var Pagination |
|
| 83 | + */ |
|
| 84 | 84 | protected Pagination $pagination; |
| 85 | 85 | |
| 86 | 86 | /** |
| 87 | - * The Template instance |
|
| 88 | - * @var Template |
|
| 89 | - */ |
|
| 87 | + * The Template instance |
|
| 88 | + * @var Template |
|
| 89 | + */ |
|
| 90 | 90 | protected Template $template; |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | - * The Flash instance |
|
| 94 | - * @var Flash |
|
| 95 | - */ |
|
| 93 | + * The Flash instance |
|
| 94 | + * @var Flash |
|
| 95 | + */ |
|
| 96 | 96 | protected Flash $flash; |
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | - * The RouteHelper instance |
|
| 100 | - * @var RouteHelper |
|
| 101 | - */ |
|
| 99 | + * The RouteHelper instance |
|
| 100 | + * @var RouteHelper |
|
| 101 | + */ |
|
| 102 | 102 | protected RouteHelper $routeHelper; |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | - * The LoggerInterface instance |
|
| 106 | - * @var LoggerInterface |
|
| 107 | - */ |
|
| 105 | + * The LoggerInterface instance |
|
| 106 | + * @var LoggerInterface |
|
| 107 | + */ |
|
| 108 | 108 | protected LoggerInterface $logger; |
| 109 | 109 | |
| 110 | 110 | /** |
| 111 | - * The Repository instance |
|
| 112 | - * @var Repository<TEntity> |
|
| 113 | - */ |
|
| 111 | + * The Repository instance |
|
| 112 | + * @var Repository<TEntity> |
|
| 113 | + */ |
|
| 114 | 114 | protected Repository $repository; |
| 115 | 115 | |
| 116 | 116 | /** |
@@ -198,14 +198,14 @@ discard block |
||
| 198 | 198 | protected string $validatorClass; |
| 199 | 199 | |
| 200 | 200 | /** |
| 201 | - * Create new instance |
|
| 202 | - * @param Lang $lang |
|
| 203 | - * @param Pagination $pagination |
|
| 204 | - * @param Template $template |
|
| 205 | - * @param Flash $flash |
|
| 206 | - * @param RouteHelper $routeHelper |
|
| 207 | - * @param LoggerInterface $logger |
|
| 208 | - */ |
|
| 201 | + * Create new instance |
|
| 202 | + * @param Lang $lang |
|
| 203 | + * @param Pagination $pagination |
|
| 204 | + * @param Template $template |
|
| 205 | + * @param Flash $flash |
|
| 206 | + * @param RouteHelper $routeHelper |
|
| 207 | + * @param LoggerInterface $logger |
|
| 208 | + */ |
|
| 209 | 209 | public function __construct( |
| 210 | 210 | Lang $lang, |
| 211 | 211 | Pagination $pagination, |
@@ -223,10 +223,10 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | /** |
| 226 | - * List all entities |
|
| 227 | - * @param ServerRequestInterface $request |
|
| 228 | - * @return ResponseInterface |
|
| 229 | - */ |
|
| 226 | + * List all entities |
|
| 227 | + * @param ServerRequestInterface $request |
|
| 228 | + * @return ResponseInterface |
|
| 229 | + */ |
|
| 230 | 230 | public function index(ServerRequestInterface $request): ResponseInterface |
| 231 | 231 | { |
| 232 | 232 | $context = []; |
@@ -238,14 +238,14 @@ discard block |
||
| 238 | 238 | $currentPage = (int) $param->get('page', 1); |
| 239 | 239 | |
| 240 | 240 | $this->pagination->setTotalItems($totalItems) |
| 241 | - ->setCurrentPage($currentPage); |
|
| 241 | + ->setCurrentPage($currentPage); |
|
| 242 | 242 | |
| 243 | 243 | $limit = $this->pagination->getItemsPerPage(); |
| 244 | 244 | $offset = $this->pagination->getOffset(); |
| 245 | 245 | |
| 246 | 246 | $query = $this->repository->query(); |
| 247 | 247 | $query->offset($offset) |
| 248 | - ->limit($limit); |
|
| 248 | + ->limit($limit); |
|
| 249 | 249 | |
| 250 | 250 | if (count($this->orderFields) > 0) { |
| 251 | 251 | foreach ($this->orderFields as $field => $dir) { |
@@ -271,10 +271,10 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | /** |
| 274 | - * List entity detail |
|
| 275 | - * @param ServerRequestInterface $request |
|
| 276 | - * @return ResponseInterface |
|
| 277 | - */ |
|
| 274 | + * List entity detail |
|
| 275 | + * @param ServerRequestInterface $request |
|
| 276 | + * @return ResponseInterface |
|
| 277 | + */ |
|
| 278 | 278 | public function detail(ServerRequestInterface $request): ResponseInterface |
| 279 | 279 | { |
| 280 | 280 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -302,10 +302,10 @@ discard block |
||
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | /** |
| 305 | - * Create new entity |
|
| 306 | - * @param ServerRequestInterface $request |
|
| 307 | - * @return ResponseInterface |
|
| 308 | - */ |
|
| 305 | + * Create new entity |
|
| 306 | + * @param ServerRequestInterface $request |
|
| 307 | + * @return ResponseInterface |
|
| 308 | + */ |
|
| 309 | 309 | public function create(ServerRequestInterface $request): ResponseInterface |
| 310 | 310 | { |
| 311 | 311 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -379,10 +379,10 @@ discard block |
||
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | /** |
| 382 | - * Update existing entity |
|
| 383 | - * @param ServerRequestInterface $request |
|
| 384 | - * @return ResponseInterface |
|
| 385 | - */ |
|
| 382 | + * Update existing entity |
|
| 383 | + * @param ServerRequestInterface $request |
|
| 384 | + * @return ResponseInterface |
|
| 385 | + */ |
|
| 386 | 386 | public function update(ServerRequestInterface $request): ResponseInterface |
| 387 | 387 | { |
| 388 | 388 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -468,10 +468,10 @@ discard block |
||
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | /** |
| 471 | - * Delete the entity |
|
| 472 | - * @param ServerRequestInterface $request |
|
| 473 | - * @return ResponseInterface |
|
| 474 | - */ |
|
| 471 | + * Delete the entity |
|
| 472 | + * @param ServerRequestInterface $request |
|
| 473 | + * @return ResponseInterface |
|
| 474 | + */ |
|
| 475 | 475 | public function delete(ServerRequestInterface $request): ResponseInterface |
| 476 | 476 | { |
| 477 | 477 | $routeListName = sprintf('%s_list', $this->routePrefix); |
@@ -69,8 +69,7 @@ |
||
| 69 | 69 | * @package Platine\Framework\Http\Action |
| 70 | 70 | * @template TEntity as Entity |
| 71 | 71 | */ |
| 72 | -class CrudAction |
|
| 73 | -{ |
|
| 72 | +class CrudAction { |
|
| 74 | 73 | /** |
| 75 | 74 | * The Lang instance |
| 76 | 75 | * @var Lang |