Passed
Push — master ( c606fb...d7b7f6 )
by nguereza
11:42
created
config/routes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,6 +4,6 @@
 block discarded – undo
4 4
     use Platine\App\Http\Action\HomeAction;
5 5
     use Platine\Route\Router;
6 6
 
7
-    return [static function (Router $router): void {
7
+    return [static function(Router $router): void {
8 8
         $router->get('/', HomeAction::class, 'home');
9 9
     }];
Please login to merge, or discard this patch.
app/Console/Command/ServerCommand.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,14 +54,12 @@
 block discarded – undo
54 54
  * @class ServerCommand
55 55
  * @package Platine\App\Console\Command
56 56
  */
57
-class ServerCommand extends Command
58
-{
57
+class ServerCommand extends Command {
59 58
     /**
60 59
      * Create new instance
61 60
      * {@inheritdoc}
62 61
      */
63
-    public function __construct(protected Shell $shell)
64
-    {
62
+    public function __construct(protected Shell $shell) {
65 63
         parent::__construct('server', 'Command to manage PHP development server');
66 64
         $this->addOption('-a|--address', 'Server address', 'localhost', true);
67 65
         $this->addOption('-p|--port', 'Server listen port', '8080', true);
Please login to merge, or discard this patch.
app/Http/Action/HomeAction.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,10 +92,10 @@  discard block
 block discarded – undo
92 92
         $context = [];
93 93
         $context['user_status'] = $this->statusList->getUserStatus();
94 94
         $context['total_user'] = $this->userRepository->query()
95
-                                                      ->count('id');
95
+                                                        ->count('id');
96 96
 
97 97
         $context['total_role'] = $this->roleRepository->query()
98
-                                                      ->count('id');
98
+                                                        ->count('id');
99 99
 
100 100
         $context['total_product_category'] = $this->productCategoryRepository->query()
101 101
                                                                             ->count('id');
@@ -119,8 +119,8 @@  discard block
 block discarded – undo
119 119
         $context['product_amounts'] = $this->productRepository->query()
120 120
                                                             ->sum(function (Expression $e) {
121 121
                                                                 $e->column('price')
122
-                                                                  ->op('*')
123
-                                                                  ->column('quantity');
122
+                                                                    ->op('*')
123
+                                                                    ->column('quantity');
124 124
                                                             });
125 125
 
126 126
         return new TemplateResponse(
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@
 block discarded – undo
63 63
  * @class HomeAction
64 64
  * @package Platine\App\Http\Action
65 65
  */
66
-class HomeAction implements RequestHandlerInterface
67
-{
66
+class HomeAction implements RequestHandlerInterface {
68 67
     /**
69 68
      * Create new instance
70 69
      * @param Template $template
Please login to merge, or discard this patch.
app/Http/Action/Permission/PermissionAction.php 2 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -28,15 +28,15 @@  discard block
 block discarded – undo
28 28
 class PermissionAction
29 29
 {
30 30
     /**
31
-    * Create new instance
32
-    * @param Lang $lang
33
-    * @param Pagination $pagination
34
-    * @param Template $template
35
-    * @param Flash $flash
36
-    * @param RouteHelper $routeHelper
37
-    * @param LoggerInterface $logger
38
-    * @param PermissionRepository $permissionRepository
39
-    */
31
+     * Create new instance
32
+     * @param Lang $lang
33
+     * @param Pagination $pagination
34
+     * @param Template $template
35
+     * @param Flash $flash
36
+     * @param RouteHelper $routeHelper
37
+     * @param LoggerInterface $logger
38
+     * @param PermissionRepository $permissionRepository
39
+     */
40 40
     public function __construct(
41 41
         protected Lang $lang,
42 42
         protected Pagination $pagination,
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
     }
50 50
 
51 51
     /**
52
-    * List all entities
53
-    * @param ServerRequestInterface $request
54
-    * @return ResponseInterface
55
-    */
52
+     * List all entities
53
+     * @param ServerRequestInterface $request
54
+     * @return ResponseInterface
55
+     */
56 56
     public function index(ServerRequestInterface $request): ResponseInterface
57 57
     {
58 58
         $context = [];
59 59
         $param = new RequestData($request);
60 60
         $totalItems = $this->permissionRepository->query()
61
-                                               ->count('id');
61
+                                                ->count('id');
62 62
 
63 63
         $currentPage = (int) $param->get('page', 1);
64 64
 
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
     }
87 87
 
88 88
     /**
89
-    * List entity detail
90
-    * @param ServerRequestInterface $request
91
-    * @return ResponseInterface
92
-    */
89
+     * List entity detail
90
+     * @param ServerRequestInterface $request
91
+     * @return ResponseInterface
92
+     */
93 93
     public function detail(ServerRequestInterface $request): ResponseInterface
94 94
     {
95 95
         $context = [];
@@ -115,10 +115,10 @@  discard block
 block discarded – undo
115 115
     }
116 116
 
117 117
     /**
118
-    * Create new entity
119
-    * @param ServerRequestInterface $request
120
-    * @return ResponseInterface
121
-    */
118
+     * Create new entity
119
+     * @param ServerRequestInterface $request
120
+     * @return ResponseInterface
121
+     */
122 122
     public function create(ServerRequestInterface $request): ResponseInterface
123 123
     {
124 124
         $context = [];
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $context['param'] = $formParam;
129 129
 
130 130
         $permissions = $this->permissionRepository->orderBy('code')
131
-                                                  ->all();
131
+                                                    ->all();
132 132
 
133 133
         $context['permissions'] = $permissions;
134 134
 
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         $entityExist = $this->permissionRepository->findBy([
155
-                                               'code' => $formParam->getCode(),
156
-                                           ]);
155
+                                                'code' => $formParam->getCode(),
156
+                                            ]);
157 157
 
158 158
         if ($entityExist !== null) {
159 159
             $this->flash->setError($this->lang->tr('This record already exist'));
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
         /** @var Permission $permission */
169 169
         $permission = $this->permissionRepository->create([
170
-           'code' => $formParam->getCode(),
171
-           'description' => $formParam->getDescription(),
170
+            'code' => $formParam->getCode(),
171
+            'description' => $formParam->getDescription(),
172 172
         ]);
173 173
 
174 174
         try {
@@ -193,10 +193,10 @@  discard block
 block discarded – undo
193 193
     }
194 194
 
195 195
     /**
196
-    * Update existing entity
197
-    * @param ServerRequestInterface $request
198
-    * @return ResponseInterface
199
-    */
196
+     * Update existing entity
197
+     * @param ServerRequestInterface $request
198
+     * @return ResponseInterface
199
+     */
200 200
     public function update(ServerRequestInterface $request): ResponseInterface
201 201
     {
202 202
         $context = [];
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
         $context['param'] = (new PermissionParam())->fromEntity($permission);
219 219
 
220 220
         $permissions = $this->permissionRepository->orderBy('code')
221
-                                                  ->all();
221
+                                                    ->all();
222 222
 
223 223
         $context['permissions'] = $permissions;
224 224
 
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
         }
245 245
 
246 246
         $entityExist = $this->permissionRepository->findBy([
247
-                                               'code' => $formParam->getCode(),
248
-                                           ]);
247
+                                                'code' => $formParam->getCode(),
248
+                                            ]);
249 249
 
250 250
         if ($entityExist !== null && $entityExist->id !== $id) {
251 251
             $this->flash->setError($this->lang->tr('This record already exist'));
@@ -282,10 +282,10 @@  discard block
 block discarded – undo
282 282
     }
283 283
 
284 284
     /**
285
-    * Delete the entity
286
-    * @param ServerRequestInterface $request
287
-    * @return ResponseInterface
288
-    */
285
+     * Delete the entity
286
+     * @param ServerRequestInterface $request
287
+     * @return ResponseInterface
288
+     */
289 289
     public function delete(ServerRequestInterface $request): ResponseInterface
290 290
     {
291 291
         $id = (int) $request->getAttribute('id');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,8 +25,7 @@
 block discarded – undo
25 25
 * @class PermissionAction
26 26
 * @package Platine\App\Http\Action\Permission
27 27
 */
28
-class PermissionAction
29
-{
28
+class PermissionAction {
30 29
     /**
31 30
     * Create new instance
32 31
     * @param Lang $lang
Please login to merge, or discard this patch.
app/Http/Action/User/UserAction.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
 class UserAction
34 34
 {
35 35
     /**
36
-    * Create new instance
37
-    * @param Lang $lang
38
-    * @param Pagination $pagination
39
-    * @param Template $template
40
-    * @param Flash $flash
41
-    * @param RouteHelper $routeHelper
42
-    * @param LoggerInterface $logger
43
-    * @param RoleRepository $roleRepository
44
-    * @param StatusList $statusList
45
-    * @param HashInterface $hash
46
-    * @param UserRepository $userRepository
47
-    */
36
+     * Create new instance
37
+     * @param Lang $lang
38
+     * @param Pagination $pagination
39
+     * @param Template $template
40
+     * @param Flash $flash
41
+     * @param RouteHelper $routeHelper
42
+     * @param LoggerInterface $logger
43
+     * @param RoleRepository $roleRepository
44
+     * @param StatusList $statusList
45
+     * @param HashInterface $hash
46
+     * @param UserRepository $userRepository
47
+     */
48 48
     public function __construct(
49 49
         protected Lang $lang,
50 50
         protected Pagination $pagination,
@@ -60,16 +60,16 @@  discard block
 block discarded – undo
60 60
     }
61 61
 
62 62
     /**
63
-    * List all entities
64
-    * @param ServerRequestInterface $request
65
-    * @return ResponseInterface
66
-    */
63
+     * List all entities
64
+     * @param ServerRequestInterface $request
65
+     * @return ResponseInterface
66
+     */
67 67
     public function index(ServerRequestInterface $request): ResponseInterface
68 68
     {
69 69
         $context = [];
70 70
         $param = new RequestData($request);
71 71
         $totalItems = $this->userRepository->query()
72
-                                               ->count('id');
72
+                                                ->count('id');
73 73
 
74 74
         $currentPage = (int) $param->get('page', 1);
75 75
 
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
     }
100 100
 
101 101
     /**
102
-    * List entity detail
103
-    * @param ServerRequestInterface $request
104
-    * @return ResponseInterface
105
-    */
102
+     * List entity detail
103
+     * @param ServerRequestInterface $request
104
+     * @return ResponseInterface
105
+     */
106 106
     public function detail(ServerRequestInterface $request): ResponseInterface
107 107
     {
108 108
         $context = [];
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
     }
130 130
 
131 131
     /**
132
-    * Create new entity
133
-    * @param ServerRequestInterface $request
134
-    * @return ResponseInterface
135
-    */
132
+     * Create new entity
133
+     * @param ServerRequestInterface $request
134
+     * @return ResponseInterface
135
+     */
136 136
     public function create(ServerRequestInterface $request): ResponseInterface
137 137
     {
138 138
         $context = [];
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         $formParam = new UserParam($param->posts());
142 142
         $context['param'] = $formParam;
143 143
         $context['roles'] = $this->roleRepository->orderBy('name')
144
-                                                 ->all();
144
+                                                    ->all();
145 145
 
146 146
         $context['user_status'] = $this->statusList->getUserStatus();
147 147
 
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
         }
167 167
 
168 168
         $usernameExist = $this->userRepository->findBy([
169
-                                               'username' => $formParam->getUsername(),
170
-                                           ]);
169
+                                                'username' => $formParam->getUsername(),
170
+                                            ]);
171 171
 
172 172
         if ($usernameExist !== null) {
173 173
             $this->flash->setError($this->lang->tr('This username already exist'));
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
         }
181 181
 
182 182
         $emailExist = $this->userRepository->findBy([
183
-                                               'email' => $formParam->getEmail(),
184
-                                           ]);
183
+                                                'email' => $formParam->getEmail(),
184
+                                            ]);
185 185
 
186 186
         if ($emailExist !== null) {
187 187
             $this->flash->setError($this->lang->tr('This email already exist'));
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
 
198 198
         /** @var User $user */
199 199
         $user = $this->userRepository->create([
200
-           'username' => $formParam->getUsername(),
200
+            'username' => $formParam->getUsername(),
201 201
         'lastname' => Str::upper($formParam->getLastname()),
202 202
         'firstname' => Str::ucfirst($formParam->getFirstname()),
203 203
         'email' => $formParam->getEmail(),
@@ -234,10 +234,10 @@  discard block
 block discarded – undo
234 234
     }
235 235
 
236 236
     /**
237
-    * Update existing entity
238
-    * @param ServerRequestInterface $request
239
-    * @return ResponseInterface
240
-    */
237
+     * Update existing entity
238
+     * @param ServerRequestInterface $request
239
+     * @return ResponseInterface
240
+     */
241 241
     public function update(ServerRequestInterface $request): ResponseInterface
242 242
     {
243 243
         $context = [];
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
         $context['param']->setRoles($currentRolesId);
262 262
 
263 263
         $context['roles'] = $this->roleRepository->orderBy('name')
264
-                                                 ->all();
264
+                                                    ->all();
265 265
 
266 266
         $context['user_status'] = $this->statusList->getUserStatus();
267 267
 
@@ -287,8 +287,8 @@  discard block
 block discarded – undo
287 287
         }
288 288
 
289 289
         $usernameExist = $this->userRepository->findBy([
290
-                                               'username' => $formParam->getUsername(),
291
-                                           ]);
290
+                                                'username' => $formParam->getUsername(),
291
+                                            ]);
292 292
 
293 293
         if ($usernameExist !== null && $usernameExist->id !== $id) {
294 294
             $this->flash->setError($this->lang->tr('This username already exist'));
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
         }
302 302
 
303 303
         $emailExist = $this->userRepository->findBy([
304
-                                               'email' => $formParam->getEmail(),
305
-                                           ]);
304
+                                                'email' => $formParam->getEmail(),
305
+                                            ]);
306 306
 
307 307
         if ($emailExist !== null && $emailExist->id !== $id) {
308 308
             $this->flash->setError($this->lang->tr('This email already exist'));
@@ -363,10 +363,10 @@  discard block
 block discarded – undo
363 363
     }
364 364
 
365 365
     /**
366
-    * Delete the entity
367
-    * @param ServerRequestInterface $request
368
-    * @return ResponseInterface
369
-    */
366
+     * Delete the entity
367
+     * @param ServerRequestInterface $request
368
+     * @return ResponseInterface
369
+     */
370 370
     public function delete(ServerRequestInterface $request): ResponseInterface
371 371
     {
372 372
         $id = (int) $request->getAttribute('id');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,7 @@
 block discarded – undo
30 30
 * @class UserAction
31 31
 * @package Platine\App\Http\Action\User
32 32
 */
33
-class UserAction
34
-{
33
+class UserAction {
35 34
     /**
36 35
     * Create new instance
37 36
     * @param Lang $lang
Please login to merge, or discard this patch.
app/Http/Action/User/LogoutAction.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 class LogoutAction implements RequestHandlerInterface
21 21
 {
22 22
     /**
23
-    * Create new instance
24
-    * @param AuthenticationInterface $authentication
25
-    * @param Flash $flash
26
-    * @param RouteHelper $routeHelper
27
-    * @param Lang $lang
28
-    */
23
+     * Create new instance
24
+     * @param AuthenticationInterface $authentication
25
+     * @param Flash $flash
26
+     * @param RouteHelper $routeHelper
27
+     * @param Lang $lang
28
+     */
29 29
     public function __construct(
30 30
         protected AuthenticationInterface $authentication,
31 31
         protected Flash $flash,
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
     }
36 36
 
37 37
     /**
38
-    * {@inheritdoc}
39
-    */
38
+     * {@inheritdoc}
39
+     */
40 40
     public function handle(ServerRequestInterface $request): ResponseInterface
41 41
     {
42 42
         $this->authentication->logout();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
 * @class LogoutAction
18 18
 * @package Platine\App\Http\Action\User
19 19
 */
20
-class LogoutAction implements RequestHandlerInterface
21
-{
20
+class LogoutAction implements RequestHandlerInterface {
22 21
     /**
23 22
     * Create new instance
24 23
     * @param AuthenticationInterface $authentication
Please login to merge, or discard this patch.
app/Http/Action/User/UserProfileAction.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
 class UserProfileAction
31 31
 {
32 32
     /**
33
-    * Create new instance
34
-    * @param Lang $lang
35
-    * @param AuthenticationInterface $authentication
36
-    * @param Template $template
37
-    * @param Flash $flash
38
-    * @param RouteHelper $routeHelper
39
-    * @param LoggerInterface $logger
40
-    * @param StatusList $statusList
41
-    * @param HashInterface $hash
42
-    * @param UserRepository $userRepository
43
-    */
33
+     * Create new instance
34
+     * @param Lang $lang
35
+     * @param AuthenticationInterface $authentication
36
+     * @param Template $template
37
+     * @param Flash $flash
38
+     * @param RouteHelper $routeHelper
39
+     * @param LoggerInterface $logger
40
+     * @param StatusList $statusList
41
+     * @param HashInterface $hash
42
+     * @param UserRepository $userRepository
43
+     */
44 44
     public function __construct(
45 45
         protected Lang $lang,
46 46
         protected AuthenticationInterface $authentication,
@@ -55,10 +55,10 @@  discard block
 block discarded – undo
55 55
     }
56 56
 
57 57
     /**
58
-    * User profile
59
-    * @param ServerRequestInterface $request
60
-    * @return ResponseInterface
61
-    */
58
+     * User profile
59
+     * @param ServerRequestInterface $request
60
+     * @return ResponseInterface
61
+     */
62 62
     public function detail(ServerRequestInterface $request): ResponseInterface
63 63
     {
64 64
         $context = [];
@@ -88,10 +88,10 @@  discard block
 block discarded – undo
88 88
     }
89 89
 
90 90
     /**
91
-    * Update user profile
92
-    * @param ServerRequestInterface $request
93
-    * @return ResponseInterface
94
-    */
91
+     * Update user profile
92
+     * @param ServerRequestInterface $request
93
+     * @return ResponseInterface
94
+     */
95 95
     public function update(ServerRequestInterface $request): ResponseInterface
96 96
     {
97 97
         $context = [];
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $user = $this->userRepository->find($id);
104 104
 
105 105
         if ($user === null) {
106
-             $this->authentication->logout();
106
+                $this->authentication->logout();
107 107
 
108 108
             $this->flash->setError($this->lang->tr('This record doesn\'t exist'));
109 109
 
@@ -138,8 +138,8 @@  discard block
 block discarded – undo
138 138
         }
139 139
 
140 140
         $usernameExist = $this->userRepository->findBy([
141
-                                               'username' => $formParam->getUsername(),
142
-                                           ]);
141
+                                                'username' => $formParam->getUsername(),
142
+                                            ]);
143 143
 
144 144
         if ($usernameExist !== null && $usernameExist->id !== $id) {
145 145
             $this->flash->setError($this->lang->tr('This username already exist'));
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
         }
153 153
 
154 154
         $emailExist = $this->userRepository->findBy([
155
-                                               'email' => $formParam->getEmail(),
156
-                                           ]);
155
+                                                'email' => $formParam->getEmail(),
156
+                                            ]);
157 157
 
158 158
         if ($emailExist !== null && $emailExist->id !== $id) {
159 159
             $this->flash->setError($this->lang->tr('This email already exist'));
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@
 block discarded – undo
27 27
 * @class UserProfileAction
28 28
 * @package Platine\App\Http\Action\User
29 29
 */
30
-class UserProfileAction
31
-{
30
+class UserProfileAction {
32 31
     /**
33 32
     * Create new instance
34 33
     * @param Lang $lang
Please login to merge, or discard this patch.
app/Http/Action/User/AuthAction.php 2 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,14 +27,14 @@  discard block
 block discarded – undo
27 27
 class AuthAction implements RequestHandlerInterface
28 28
 {
29 29
     /**
30
-    * Create new instance
31
-    * @param AuthenticationInterface $authentication
32
-    * @param Flash $flash
33
-    * @param RouteHelper $routeHelper
34
-    * @param Lang $lang
35
-    * @param LoggerInterface $logger
36
-    * @param Template $template
37
-    */
30
+     * Create new instance
31
+     * @param AuthenticationInterface $authentication
32
+     * @param Flash $flash
33
+     * @param RouteHelper $routeHelper
34
+     * @param Lang $lang
35
+     * @param LoggerInterface $logger
36
+     * @param Template $template
37
+     */
38 38
     public function __construct(
39 39
         protected AuthenticationInterface $authentication,
40 40
         protected Flash $flash,
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
     }
47 47
 
48 48
     /**
49
-    * {@inheritdoc}
50
-    */
49
+     * {@inheritdoc}
50
+     */
51 51
     public function handle(ServerRequestInterface $request): ResponseInterface
52 52
     {
53 53
         $context = [];
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,8 +24,7 @@
 block discarded – undo
24 24
 * @class AuthAction
25 25
 * @package Platine\App\Http\Action\User
26 26
 */
27
-class AuthAction implements RequestHandlerInterface
28
-{
27
+class AuthAction implements RequestHandlerInterface {
29 28
     /**
30 29
     * Create new instance
31 30
     * @param AuthenticationInterface $authentication
Please login to merge, or discard this patch.
app/Http/Action/Product/ProductAction.php 2 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -29,16 +29,16 @@  discard block
 block discarded – undo
29 29
 class ProductAction
30 30
 {
31 31
     /**
32
-    * Create new instance
33
-    * @param Lang $lang
34
-    * @param Pagination $pagination
35
-    * @param Template $template
36
-    * @param Flash $flash
37
-    * @param RouteHelper $routeHelper
38
-    * @param LoggerInterface $logger
39
-    * @param ProductCategoryRepository $productCategoryRepository
40
-    * @param ProductRepository $productRepository
41
-    */
32
+     * Create new instance
33
+     * @param Lang $lang
34
+     * @param Pagination $pagination
35
+     * @param Template $template
36
+     * @param Flash $flash
37
+     * @param RouteHelper $routeHelper
38
+     * @param LoggerInterface $logger
39
+     * @param ProductCategoryRepository $productCategoryRepository
40
+     * @param ProductRepository $productRepository
41
+     */
42 42
     public function __construct(
43 43
         protected Lang $lang,
44 44
         protected Pagination $pagination,
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
     }
53 53
 
54 54
     /**
55
-    * List all entities
56
-    * @param ServerRequestInterface $request
57
-    * @return ResponseInterface
58
-    */
55
+     * List all entities
56
+     * @param ServerRequestInterface $request
57
+     * @return ResponseInterface
58
+     */
59 59
     public function index(ServerRequestInterface $request): ResponseInterface
60 60
     {
61 61
         $context = [];
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
         }
75 75
 
76 76
         $totalItems = $this->productRepository->query()
77
-                                              ->filter($filters)
78
-                                               ->count('id');
77
+                                                ->filter($filters)
78
+                                                ->count('id');
79 79
 
80 80
         $currentPage = (int) $param->get('page', 1);
81 81
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                                             ->all();
95 95
 
96 96
         $categories = $this->productCategoryRepository->orderBy('name')
97
-                                                      ->all();
97
+                                                        ->all();
98 98
 
99 99
         $context['categories'] = $categories;
100 100
 
@@ -111,10 +111,10 @@  discard block
 block discarded – undo
111 111
     }
112 112
 
113 113
     /**
114
-    * List entity detail
115
-    * @param ServerRequestInterface $request
116
-    * @return ResponseInterface
117
-    */
114
+     * List entity detail
115
+     * @param ServerRequestInterface $request
116
+     * @return ResponseInterface
117
+     */
118 118
     public function detail(ServerRequestInterface $request): ResponseInterface
119 119
     {
120 120
         $context = [];
@@ -140,10 +140,10 @@  discard block
 block discarded – undo
140 140
     }
141 141
 
142 142
     /**
143
-    * Create new entity
144
-    * @param ServerRequestInterface $request
145
-    * @return ResponseInterface
146
-    */
143
+     * Create new entity
144
+     * @param ServerRequestInterface $request
145
+     * @return ResponseInterface
146
+     */
147 147
     public function create(ServerRequestInterface $request): ResponseInterface
148 148
     {
149 149
         $context = [];
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         $context['param'] = $formParam;
154 154
 
155 155
         $categories = $this->productCategoryRepository->orderBy('name')
156
-                                                      ->all();
156
+                                                        ->all();
157 157
 
158 158
         $context['categories'] = $categories;
159 159
 
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
         }
178 178
 
179 179
         $entityExist = $this->productRepository->findBy([
180
-                                               'name' => $formParam->getName(),
181
-                                           ]);
180
+                                                'name' => $formParam->getName(),
181
+                                            ]);
182 182
 
183 183
         if ($entityExist !== null) {
184 184
             $this->flash->setError($this->lang->tr('This record already exist'));
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
         /** @var Product $product */
194 194
         $product = $this->productRepository->create([
195
-           'name' => $formParam->getName(),
195
+            'name' => $formParam->getName(),
196 196
         'description' => $formParam->getDescription(),
197 197
         'price' => $formParam->getPrice(),
198 198
         'quantity' => $formParam->getQuantity(),
@@ -221,10 +221,10 @@  discard block
 block discarded – undo
221 221
     }
222 222
 
223 223
     /**
224
-    * Update existing entity
225
-    * @param ServerRequestInterface $request
226
-    * @return ResponseInterface
227
-    */
224
+     * Update existing entity
225
+     * @param ServerRequestInterface $request
226
+     * @return ResponseInterface
227
+     */
228 228
     public function update(ServerRequestInterface $request): ResponseInterface
229 229
     {
230 230
         $context = [];
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         $context['param'] = (new ProductParam())->fromEntity($product);
247 247
 
248 248
         $categories = $this->productCategoryRepository->orderBy('name')
249
-                                                      ->all();
249
+                                                        ->all();
250 250
 
251 251
         $context['categories'] = $categories;
252 252
 
@@ -272,8 +272,8 @@  discard block
 block discarded – undo
272 272
         }
273 273
 
274 274
         $entityExist = $this->productRepository->findBy([
275
-                                               'name' => $formParam->getName(),
276
-                                           ]);
275
+                                                'name' => $formParam->getName(),
276
+                                            ]);
277 277
 
278 278
         if ($entityExist !== null && $entityExist->id !== $id) {
279 279
             $this->flash->setError($this->lang->tr('This record already exist'));
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
     }
314 314
 
315 315
     /**
316
-    * Delete the entity
317
-    * @param ServerRequestInterface $request
318
-    * @return ResponseInterface
319
-    */
316
+     * Delete the entity
317
+     * @param ServerRequestInterface $request
318
+     * @return ResponseInterface
319
+     */
320 320
     public function delete(ServerRequestInterface $request): ResponseInterface
321 321
     {
322 322
         $id = (int) $request->getAttribute('id');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,8 +26,7 @@
 block discarded – undo
26 26
 * @class ProductAction
27 27
 * @package Platine\App\Http\Action\Product
28 28
 */
29
-class ProductAction
30
-{
29
+class ProductAction {
31 30
     /**
32 31
     * Create new instance
33 32
     * @param Lang $lang
Please login to merge, or discard this patch.