@@ -132,8 +132,8 @@ discard block |
||
| 132 | 132 | public function handle(ServerRequestInterface $request): ResponseInterface |
| 133 | 133 | { |
| 134 | 134 | $permissions = $this->permissionRepository |
| 135 | - ->orderBy('code') |
|
| 136 | - ->all(); |
|
| 135 | + ->orderBy('code') |
|
| 136 | + ->all(); |
|
| 137 | 137 | |
| 138 | 138 | if ($request->getMethod() === 'GET') { |
| 139 | 139 | return new TemplateResponse( |
@@ -172,8 +172,8 @@ discard block |
||
| 172 | 172 | $this->template, |
| 173 | 173 | 'permission/create', |
| 174 | 174 | [ |
| 175 | - 'param' => $formParam, |
|
| 176 | - 'permissions' => $permissions |
|
| 175 | + 'param' => $formParam, |
|
| 176 | + 'permissions' => $permissions |
|
| 177 | 177 | ] |
| 178 | 178 | ); |
| 179 | 179 | } |
@@ -194,8 +194,8 @@ discard block |
||
| 194 | 194 | $this->template, |
| 195 | 195 | 'permission/create', |
| 196 | 196 | [ |
| 197 | - 'param' => $formParam, |
|
| 198 | - 'permissions' => $permissions |
|
| 197 | + 'param' => $formParam, |
|
| 198 | + 'permissions' => $permissions |
|
| 199 | 199 | ] |
| 200 | 200 | ); |
| 201 | 201 | } |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * @package Platine\Framework\Demo\Action\Permission |
| 69 | 69 | * @template T |
| 70 | 70 | */ |
| 71 | -class CreateAction implements RequestHandlerInterface |
|
| 72 | -{ |
|
| 71 | +class CreateAction implements RequestHandlerInterface { |
|
| 73 | 72 | |
| 74 | 73 | /** |
| 75 | 74 | * Logger instance |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | $permissions = $this->permissionRepository |
| 145 | - ->orderBy('code') |
|
| 146 | - ->all(); |
|
| 145 | + ->orderBy('code') |
|
| 146 | + ->all(); |
|
| 147 | 147 | |
| 148 | 148 | |
| 149 | 149 | $entityToFormParam = (new PermissionParam())->fromEntity($permission); |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | $this->template, |
| 186 | 186 | 'permission/edit', |
| 187 | 187 | [ |
| 188 | - 'param' => $formParam, |
|
| 189 | - 'permissions' => $permissions |
|
| 188 | + 'param' => $formParam, |
|
| 189 | + 'permissions' => $permissions |
|
| 190 | 190 | ] |
| 191 | 191 | ); |
| 192 | 192 | } |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $this->template, |
| 205 | 205 | 'permission/edit', |
| 206 | 206 | [ |
| 207 | - 'param' => $formParam, |
|
| 208 | - 'permissions' => $permissions |
|
| 207 | + 'param' => $formParam, |
|
| 208 | + 'permissions' => $permissions |
|
| 209 | 209 | ] |
| 210 | 210 | ); |
| 211 | 211 | } |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * @package Platine\Framework\Demo\Action\Permission |
| 69 | 69 | * @template T |
| 70 | 70 | */ |
| 71 | -class EditAction implements RequestHandlerInterface |
|
| 72 | -{ |
|
| 71 | +class EditAction implements RequestHandlerInterface { |
|
| 73 | 72 | |
| 74 | 73 | /** |
| 75 | 74 | * The logger instance |
@@ -92,8 +92,8 @@ |
||
| 92 | 92 | public function handle(ServerRequestInterface $request): ResponseInterface |
| 93 | 93 | { |
| 94 | 94 | $permissions = $this->permissionRepository |
| 95 | - ->orderBy('code') |
|
| 96 | - ->all(); |
|
| 95 | + ->orderBy('code') |
|
| 96 | + ->all(); |
|
| 97 | 97 | |
| 98 | 98 | return new TemplateResponse( |
| 99 | 99 | $this->template, |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | * @package Platine\Framework\Demo\Action\Permission |
| 60 | 60 | * @template T |
| 61 | 61 | */ |
| 62 | -class ListAction implements RequestHandlerInterface |
|
| 63 | -{ |
|
| 62 | +class ListAction implements RequestHandlerInterface { |
|
| 64 | 63 | /** |
| 65 | 64 | * The permission repository |
| 66 | 65 | * @var PermissionRepository |
@@ -137,7 +137,7 @@ |
||
| 137 | 137 | { |
| 138 | 138 | $param = new RequestData($request); |
| 139 | 139 | |
| 140 | - $items = $param->post('items', []); |
|
| 140 | + $items = $param->post('items', []); |
|
| 141 | 141 | if (empty($items)) { |
| 142 | 142 | return new RedirectResponse( |
| 143 | 143 | $this->routeHelper->generateUrl('permission_list') |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | * @package Platine\Framework\Demo\Action\Permission |
| 64 | 64 | * @template T |
| 65 | 65 | */ |
| 66 | -class BatchAction implements RequestHandlerInterface |
|
| 67 | -{ |
|
| 66 | +class BatchAction implements RequestHandlerInterface { |
|
| 68 | 67 | |
| 69 | 68 | /** |
| 70 | 69 | * Logger instance |
@@ -173,8 +172,7 @@ discard block |
||
| 173 | 172 | * Handle delete action |
| 174 | 173 | * @return mixed|void |
| 175 | 174 | */ |
| 176 | - protected function deleteHandle() |
|
| 177 | - { |
|
| 175 | + protected function deleteHandle() { |
|
| 178 | 176 | $items = $this->items; |
| 179 | 177 | $this->logger->info('Deleted of permissions #{items}', ['items' => $items]); |
| 180 | 178 | |
@@ -94,18 +94,18 @@ |
||
| 94 | 94 | public function setRules(): void |
| 95 | 95 | { |
| 96 | 96 | $this->validator->addRules('code', [ |
| 97 | - new NotEmpty(), |
|
| 98 | - new MinLength(2), |
|
| 99 | - new AlphaDash() |
|
| 97 | + new NotEmpty(), |
|
| 98 | + new MinLength(2), |
|
| 99 | + new AlphaDash() |
|
| 100 | 100 | ]); |
| 101 | 101 | |
| 102 | 102 | $this->validator->addRules('description', [ |
| 103 | - new NotEmpty(), |
|
| 104 | - new MinLength(3) |
|
| 103 | + new NotEmpty(), |
|
| 104 | + new MinLength(3) |
|
| 105 | 105 | ]); |
| 106 | 106 | |
| 107 | 107 | $this->validator->addRules('depend', [ |
| 108 | - new MinLength(2) |
|
| 108 | + new MinLength(2) |
|
| 109 | 109 | ]); |
| 110 | 110 | } |
| 111 | 111 | } |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | * @class PermissionValidator |
| 59 | 59 | * @package Platine\Framework\Demo\Form\Validator |
| 60 | 60 | */ |
| 61 | -class PermissionValidator extends AbstractValidator |
|
| 62 | -{ |
|
| 61 | +class PermissionValidator extends AbstractValidator { |
|
| 63 | 62 | |
| 64 | 63 | /** |
| 65 | 64 | * The parameter instance |
@@ -72,8 +71,7 @@ discard block |
||
| 72 | 71 | * @param PermissionParam $param |
| 73 | 72 | * @param Validator|null $validator |
| 74 | 73 | */ |
| 75 | - public function __construct(PermissionParam $param, ?Validator $validator = null) |
|
| 76 | - { |
|
| 74 | + public function __construct(PermissionParam $param, ?Validator $validator = null) { |
|
| 77 | 75 | parent::__construct($validator); |
| 78 | 76 | $this->param = $param; |
| 79 | 77 | } |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class PermissionParam |
| 55 | 55 | * @package Platine\Framework\Demo\Form\Param |
| 56 | 56 | */ |
| 57 | -class PermissionParam extends BaseParam |
|
| 58 | -{ |
|
| 57 | +class PermissionParam extends BaseParam { |
|
| 59 | 58 | /** |
| 60 | 59 | * The code |
| 61 | 60 | * @var string |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | */ |
| 78 | 78 | public function addRoutes(Router $router): void |
| 79 | 79 | { |
| 80 | - $router->group('/permissions', function (Router $router) { |
|
| 80 | + $router->group('/permissions', function(Router $router) { |
|
| 81 | 81 | $router->get('', ListAction::class, 'permission_list'); |
| 82 | 82 | $router->post('/batch', BatchAction::class, 'permission_batch'); |
| 83 | 83 | $router->add('/add', CreateAction::class, ['GET', 'POST'], 'permission_create'); |
@@ -58,8 +58,7 @@ |
||
| 58 | 58 | * @class PermissionServiceProvider |
| 59 | 59 | * @package Platine\Framework |
| 60 | 60 | */ |
| 61 | -class PermissionServiceProvider extends ServiceProvider |
|
| 62 | -{ |
|
| 61 | +class PermissionServiceProvider extends ServiceProvider { |
|
| 63 | 62 | |
| 64 | 63 | /** |
| 65 | 64 | * {@inheritdoc} |