@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | * @package Platine\Framework\Demo\Action\User |
| 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 |
@@ -175,8 +174,7 @@ discard block |
||
| 175 | 174 | * Handle delete action |
| 176 | 175 | * @return mixed|void |
| 177 | 176 | */ |
| 178 | - protected function deleteHandle() |
|
| 179 | - { |
|
| 177 | + protected function deleteHandle() { |
|
| 180 | 178 | $items = $this->items; |
| 181 | 179 | $this->logger->info('Deleted of users #{items}', ['items' => $items]); |
| 182 | 180 | |
@@ -192,8 +190,7 @@ discard block |
||
| 192 | 190 | * Handle disable action |
| 193 | 191 | * @return mixed|void |
| 194 | 192 | */ |
| 195 | - protected function disableHandle() |
|
| 196 | - { |
|
| 193 | + protected function disableHandle() { |
|
| 197 | 194 | $items = $this->items; |
| 198 | 195 | $this->logger->info('Disable of users #{items}', ['items' => $items]); |
| 199 | 196 | |
@@ -209,8 +206,7 @@ discard block |
||
| 209 | 206 | * Handle enable action |
| 210 | 207 | * @return mixed|void |
| 211 | 208 | */ |
| 212 | - protected function enableHandle() |
|
| 213 | - { |
|
| 209 | + protected function enableHandle() { |
|
| 214 | 210 | $items = $this->items; |
| 215 | 211 | $this->logger->info('Enable of users #{items}', ['items' => $items]); |
| 216 | 212 | |
@@ -138,8 +138,8 @@ discard block |
||
| 138 | 138 | public function handle(ServerRequestInterface $request): ResponseInterface |
| 139 | 139 | { |
| 140 | 140 | $permissions = $this->permissionRepository |
| 141 | - ->orderBy('code') |
|
| 142 | - ->all(); |
|
| 141 | + ->orderBy('code') |
|
| 142 | + ->all(); |
|
| 143 | 143 | |
| 144 | 144 | if ($request->getMethod() === 'GET') { |
| 145 | 145 | return new TemplateResponse( |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | $this->template, |
| 179 | 179 | 'role/create', |
| 180 | 180 | [ |
| 181 | - 'param' => $formParam, |
|
| 182 | - 'permissions' => $permissions |
|
| 181 | + 'param' => $formParam, |
|
| 182 | + 'permissions' => $permissions |
|
| 183 | 183 | ] |
| 184 | 184 | ); |
| 185 | 185 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | 'description' => $formParam->getDescription() |
| 191 | 191 | ]); |
| 192 | 192 | |
| 193 | - //Handle permissions |
|
| 193 | + //Handle permissions |
|
| 194 | 194 | $permissionsId = $param->post('permissions', []); |
| 195 | 195 | if (!empty($permissionsId)) { |
| 196 | 196 | $selectedPermissions = $this->permissionRepository->findAll(...$permissionsId); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | $this->template, |
| 208 | 208 | 'role/create', |
| 209 | 209 | [ |
| 210 | - 'param' => $formParam, |
|
| 210 | + 'param' => $formParam, |
|
| 211 | 211 | 'permissions' => $permissions |
| 212 | 212 | ] |
| 213 | 213 | ); |
@@ -68,8 +68,7 @@ |
||
| 68 | 68 | * @package Platine\Framework\Demo\Action\Role |
| 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 |
@@ -59,8 +59,7 @@ |
||
| 59 | 59 | * @package Platine\Framework\Demo\Action\Role |
| 60 | 60 | * @template T |
| 61 | 61 | */ |
| 62 | -class ListAction implements RequestHandlerInterface |
|
| 63 | -{ |
|
| 62 | +class ListAction implements RequestHandlerInterface { |
|
| 64 | 63 | /** |
| 65 | 64 | * The role repository |
| 66 | 65 | * @var RoleRepository |
@@ -125,8 +125,8 @@ |
||
| 125 | 125 | { |
| 126 | 126 | $id = (int) $request->getAttribute('id'); |
| 127 | 127 | $role = $this->roleRepository |
| 128 | - ->with('permissions') |
|
| 129 | - ->find($id); |
|
| 128 | + ->with('permissions') |
|
| 129 | + ->find($id); |
|
| 130 | 130 | if (!$role) { |
| 131 | 131 | $this->session->setFlash('error', 'Can not find the role'); |
| 132 | 132 | $this->logger->warning('Can not find role with id {id}', ['id' => $id]); |
@@ -63,8 +63,7 @@ |
||
| 63 | 63 | * @package Platine\Framework\Demo\Action\Role |
| 64 | 64 | * @template T |
| 65 | 65 | */ |
| 66 | -class DetailAction implements RequestHandlerInterface |
|
| 67 | -{ |
|
| 66 | +class DetailAction implements RequestHandlerInterface { |
|
| 68 | 67 | |
| 69 | 68 | /** |
| 70 | 69 | * The logger instance |
@@ -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('role_list') |
@@ -63,8 +63,7 @@ discard block |
||
| 63 | 63 | * @package Platine\Framework\Demo\Action\Role |
| 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 roles #{items}', ['items' => $items]); |
| 180 | 178 | |
@@ -109,10 +109,10 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | protected RouteHelper $routeHelper; |
| 111 | 111 | |
| 112 | - /** |
|
| 113 | - * The password hash to be used |
|
| 114 | - * @var HashInterface |
|
| 115 | - */ |
|
| 112 | + /** |
|
| 113 | + * The password hash to be used |
|
| 114 | + * @var HashInterface |
|
| 115 | + */ |
|
| 116 | 116 | protected HashInterface $hash; |
| 117 | 117 | |
| 118 | 118 | /** |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | $permissions = $this->permissionRepository |
| 167 | - ->orderBy('code') |
|
| 168 | - ->all(); |
|
| 167 | + ->orderBy('code') |
|
| 168 | + ->all(); |
|
| 169 | 169 | |
| 170 | 170 | $currentPermissionsId = []; |
| 171 | 171 | foreach ($role->permissions as $entity) { |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | $this->template, |
| 213 | 213 | 'role/edit', |
| 214 | 214 | [ |
| 215 | - 'param' => $formParam, |
|
| 216 | - 'permissions' => $permissions |
|
| 215 | + 'param' => $formParam, |
|
| 216 | + 'permissions' => $permissions |
|
| 217 | 217 | ] |
| 218 | 218 | ); |
| 219 | 219 | } |
@@ -246,8 +246,8 @@ discard block |
||
| 246 | 246 | $this->template, |
| 247 | 247 | 'role/edit', |
| 248 | 248 | [ |
| 249 | - 'param' => $formParam, |
|
| 250 | - 'permissions' => $permissions |
|
| 249 | + 'param' => $formParam, |
|
| 250 | + 'permissions' => $permissions |
|
| 251 | 251 | ] |
| 252 | 252 | ); |
| 253 | 253 | } |
@@ -70,8 +70,7 @@ |
||
| 70 | 70 | * @package Platine\Framework\Demo\Action\Role |
| 71 | 71 | * @template T |
| 72 | 72 | */ |
| 73 | -class EditAction implements RequestHandlerInterface |
|
| 74 | -{ |
|
| 73 | +class EditAction implements RequestHandlerInterface { |
|
| 75 | 74 | |
| 76 | 75 | /** |
| 77 | 76 | * The logger instance |
@@ -54,8 +54,7 @@ |
||
| 54 | 54 | * @class RoleParam |
| 55 | 55 | * @package Platine\Framework\Demo\Form\Param |
| 56 | 56 | */ |
| 57 | -class RoleParam extends BaseParam |
|
| 58 | -{ |
|
| 57 | +class RoleParam extends BaseParam { |
|
| 59 | 58 | /** |
| 60 | 59 | * The name |
| 61 | 60 | * @var string |
@@ -92,12 +92,12 @@ |
||
| 92 | 92 | public function setRules(): void |
| 93 | 93 | { |
| 94 | 94 | $this->validator->addRules('name', [ |
| 95 | - new NotEmpty(), |
|
| 96 | - new MinLength(2) |
|
| 95 | + new NotEmpty(), |
|
| 96 | + new MinLength(2) |
|
| 97 | 97 | ]); |
| 98 | 98 | |
| 99 | 99 | $this->validator->addRules('description', [ |
| 100 | - new MinLength(3) |
|
| 100 | + new MinLength(3) |
|
| 101 | 101 | ]); |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | * @class RoleValidator |
| 58 | 58 | * @package Platine\Framework\Demo\Form\Validator |
| 59 | 59 | */ |
| 60 | -class RoleValidator extends AbstractValidator |
|
| 61 | -{ |
|
| 60 | +class RoleValidator extends AbstractValidator { |
|
| 62 | 61 | |
| 63 | 62 | /** |
| 64 | 63 | * The parameter instance |
@@ -71,8 +70,7 @@ discard block |
||
| 71 | 70 | * @param RoleParam $param |
| 72 | 71 | * @param Validator|null $validator |
| 73 | 72 | */ |
| 74 | - public function __construct(RoleParam $param, ?Validator $validator = null) |
|
| 75 | - { |
|
| 73 | + public function __construct(RoleParam $param, ?Validator $validator = null) { |
|
| 76 | 74 | parent::__construct($validator); |
| 77 | 75 | $this->param = $param; |
| 78 | 76 | } |
@@ -60,8 +60,7 @@ discard block |
||
| 60 | 60 | * @class UserValidator |
| 61 | 61 | * @package Platine\Framework\Demo\Form\Validator |
| 62 | 62 | */ |
| 63 | -class UserValidator extends AbstractValidator |
|
| 64 | -{ |
|
| 63 | +class UserValidator extends AbstractValidator { |
|
| 65 | 64 | |
| 66 | 65 | /** |
| 67 | 66 | * The parameter instance |
@@ -74,8 +73,7 @@ discard block |
||
| 74 | 73 | * @param UserParam $param |
| 75 | 74 | * @param Validator|null $validator |
| 76 | 75 | */ |
| 77 | - public function __construct(UserParam $param, ?Validator $validator = null) |
|
| 78 | - { |
|
| 76 | + public function __construct(UserParam $param, ?Validator $validator = null) { |
|
| 79 | 77 | parent::__construct($validator); |
| 80 | 78 | $this->param = $param; |
| 81 | 79 | } |