@@ -56,8 +56,7 @@ discard block |
||
56 | 56 | * @class HandleAuthFailure |
57 | 57 | * @package Platine\Framework\Demo\Event |
58 | 58 | */ |
59 | -class HandleAuthFailure implements ListenerInterface |
|
60 | -{ |
|
59 | +class HandleAuthFailure implements ListenerInterface { |
|
61 | 60 | |
62 | 61 | /** |
63 | 62 | * Logger instance |
@@ -69,16 +68,14 @@ discard block |
||
69 | 68 | * Create new instance |
70 | 69 | * @param LoggerInterface $logger |
71 | 70 | */ |
72 | - public function __construct(LoggerInterface $logger) |
|
73 | - { |
|
71 | + public function __construct(LoggerInterface $logger) { |
|
74 | 72 | $this->logger = $logger; |
75 | 73 | } |
76 | 74 | |
77 | 75 | /** |
78 | 76 | * {@inheritdoc} |
79 | 77 | */ |
80 | - public function handle(EventInterface $event) |
|
81 | - { |
|
78 | + public function handle(EventInterface $event) { |
|
82 | 79 | if ($event instanceof AuthInvalidPasswordEvent) { |
83 | 80 | $user = $event->getUser(); |
84 | 81 | $this->logger->error('User {email} - {username} enter wrong password ', [ |
@@ -147,7 +147,7 @@ |
||
147 | 147 | { |
148 | 148 | $param = new RequestData($request); |
149 | 149 | |
150 | - $items = $param->post('items', []); |
|
150 | + $items = $param->post('items', []); |
|
151 | 151 | if (empty($items)) { |
152 | 152 | return new RedirectResponse( |
153 | 153 | $this->routeHelper->generateUrl('user_list') |
@@ -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 |
@@ -181,9 +181,9 @@ |
||
181 | 181 | $this->logger->info('Deleted of users #{items}', ['items' => $items]); |
182 | 182 | |
183 | 183 | $this->userRepository->query() |
184 | - ->where('id') |
|
184 | + ->where('id') |
|
185 | 185 | ->in($items) |
186 | - ->delete(); |
|
186 | + ->delete(); |
|
187 | 187 | |
188 | 188 | $this->flash->setSuccess($this->lang->tr('The selected users are deleted successfully')); |
189 | 189 | } |
@@ -212,10 +212,10 @@ |
||
212 | 212 | return $this; |
213 | 213 | } |
214 | 214 | |
215 | - /** |
|
216 | - * Return the application root path |
|
217 | - * @return string |
|
218 | - */ |
|
215 | + /** |
|
216 | + * Return the application root path |
|
217 | + * @return string |
|
218 | + */ |
|
219 | 219 | public function getAppPath(): string |
220 | 220 | { |
221 | 221 | return $this->appPath; |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | * @class Application |
64 | 64 | * @package Platine\Framework\App |
65 | 65 | */ |
66 | -class Application extends Container |
|
67 | -{ |
|
66 | +class Application extends Container { |
|
68 | 67 | |
69 | 68 | /** |
70 | 69 | * The application version |
@@ -129,8 +128,7 @@ discard block |
||
129 | 128 | * Create new instance |
130 | 129 | * @param string $basePath |
131 | 130 | */ |
132 | - public function __construct(string $basePath = '') |
|
133 | - { |
|
131 | + public function __construct(string $basePath = '') { |
|
134 | 132 | parent::__construct(); |
135 | 133 | $this->basePath = $basePath; |
136 | 134 | $this->loadCoreServiceProviders(); |
@@ -161,8 +159,7 @@ discard block |
||
161 | 159 | * @param string $env |
162 | 160 | * @return $this |
163 | 161 | */ |
164 | - public function setEnvironment(string $env) |
|
165 | - { |
|
162 | + public function setEnvironment(string $env) { |
|
166 | 163 | $this->env = $env; |
167 | 164 | |
168 | 165 | return $this; |
@@ -55,8 +55,7 @@ |
||
55 | 55 | * @class CurrentUrlTag |
56 | 56 | * @package Platine\Framework\Template\Tag |
57 | 57 | */ |
58 | -class CurrentUrlTag extends AbstractTag |
|
59 | -{ |
|
58 | +class CurrentUrlTag extends AbstractTag { |
|
60 | 59 | |
61 | 60 | /** |
62 | 61 | * {@inheritdoc} |
@@ -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 |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | public function handle(ServerRequestInterface $request): ResponseInterface |
149 | 149 | { |
150 | 150 | $permissions = $this->permissionRepository |
151 | - ->orderBy('code') |
|
152 | - ->all(); |
|
151 | + ->orderBy('code') |
|
152 | + ->all(); |
|
153 | 153 | |
154 | 154 | if ($request->getMethod() === 'GET') { |
155 | 155 | return new TemplateResponse( |
@@ -188,8 +188,8 @@ discard block |
||
188 | 188 | $this->template, |
189 | 189 | 'role/create', |
190 | 190 | [ |
191 | - 'param' => $formParam, |
|
192 | - 'permissions' => $permissions |
|
191 | + 'param' => $formParam, |
|
192 | + 'permissions' => $permissions |
|
193 | 193 | ] |
194 | 194 | ); |
195 | 195 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'description' => $formParam->getDescription() |
201 | 201 | ]); |
202 | 202 | |
203 | - //Handle permissions |
|
203 | + //Handle permissions |
|
204 | 204 | $permissionsId = $param->post('permissions', []); |
205 | 205 | if (!empty($permissionsId)) { |
206 | 206 | $selectedPermissions = $this->permissionRepository->findAll(...$permissionsId); |
@@ -217,8 +217,8 @@ discard block |
||
217 | 217 | $this->template, |
218 | 218 | 'role/create', |
219 | 219 | [ |
220 | - 'param' => $formParam, |
|
221 | - 'permissions' => $permissions |
|
220 | + 'param' => $formParam, |
|
221 | + 'permissions' => $permissions |
|
222 | 222 | ] |
223 | 223 | ); |
224 | 224 | } |
@@ -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 |
@@ -109,14 +109,14 @@ |
||
109 | 109 | ->count('id'); |
110 | 110 | $currentPage = (int)$param->get('page', 1); |
111 | 111 | $this->pagination->setTotalItems($totalItems) |
112 | - ->setCurrentPage($currentPage); |
|
112 | + ->setCurrentPage($currentPage); |
|
113 | 113 | $limit = $this->pagination->getItemsPerPage(); |
114 | 114 | $offset = $this->pagination->getOffset(); |
115 | 115 | ////////// END PAGINATION ////////////////// |
116 | 116 | |
117 | 117 | $roles = $this->roleRepository |
118 | - ->limit($offset, $limit) |
|
119 | - ->all(); |
|
118 | + ->limit($offset, $limit) |
|
119 | + ->all(); |
|
120 | 120 | |
121 | 121 | return new TemplateResponse( |
122 | 122 | $this->template, |
@@ -107,7 +107,7 @@ |
||
107 | 107 | ////////// BEGIN PAGINATION ////////////////// |
108 | 108 | $totalItems = $this->roleRepository->query() |
109 | 109 | ->count('id'); |
110 | - $currentPage = (int)$param->get('page', 1); |
|
110 | + $currentPage = (int) $param->get('page', 1); |
|
111 | 111 | $this->pagination->setTotalItems($totalItems) |
112 | 112 | ->setCurrentPage($currentPage); |
113 | 113 | $limit = $this->pagination->getItemsPerPage(); |
@@ -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 |
@@ -135,8 +135,8 @@ |
||
135 | 135 | { |
136 | 136 | $id = (int) $request->getAttribute('id'); |
137 | 137 | $role = $this->roleRepository |
138 | - ->with('permissions') |
|
139 | - ->find($id); |
|
138 | + ->with('permissions') |
|
139 | + ->find($id); |
|
140 | 140 | if (!$role) { |
141 | 141 | $this->flash->setError($this->lang->tr('Can not find the role')); |
142 | 142 | $this->logger->warning('Can not find role with id {id}', ['id' => $id]); |
@@ -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 |
@@ -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 |
@@ -163,8 +163,8 @@ discard block |
||
163 | 163 | } |
164 | 164 | |
165 | 165 | $permissions = $this->permissionRepository |
166 | - ->orderBy('code') |
|
167 | - ->all(); |
|
166 | + ->orderBy('code') |
|
167 | + ->all(); |
|
168 | 168 | |
169 | 169 | $currentPermissionsId = []; |
170 | 170 | foreach ($role->permissions as $entity) { |
@@ -211,8 +211,8 @@ discard block |
||
211 | 211 | $this->template, |
212 | 212 | 'role/edit', |
213 | 213 | [ |
214 | - 'param' => $formParam, |
|
215 | - 'permissions' => $permissions |
|
214 | + 'param' => $formParam, |
|
215 | + 'permissions' => $permissions |
|
216 | 216 | ] |
217 | 217 | ); |
218 | 218 | } |
@@ -243,8 +243,8 @@ discard block |
||
243 | 243 | $this->template, |
244 | 244 | 'role/edit', |
245 | 245 | [ |
246 | - 'param' => $formParam, |
|
247 | - 'permissions' => $permissions |
|
246 | + 'param' => $formParam, |
|
247 | + 'permissions' => $permissions |
|
248 | 248 | ] |
249 | 249 | ); |
250 | 250 | } |