Passed
Push — develop ( ec03b4...36c2b4 )
by nguereza
02:46
created
src/Demo/Action/Role/BatchAction.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
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')
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Demo/Action/Role/EditAction.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -163,8 +163,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Demo/Form/Param/RoleParam.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Demo/Provider/RoleServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
      */
80 80
     public function addRoutes(Router $router): void
81 81
     {
82
-        $router->group('/roles', function (Router $router) {
82
+        $router->group('/roles', function(Router $router) {
83 83
             $router->get('', ListAction::class, 'role_list');
84 84
             $router->get('/detail/{id:i}', DetailAction::class, 'role_detail');
85 85
             $router->post('/batch', BatchAction::class, 'role_batch');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
59 59
  * @class RoleServiceProvider
60 60
  * @package Platine\Framework
61 61
  */
62
-class RoleServiceProvider extends ServiceProvider
63
-{
62
+class RoleServiceProvider extends ServiceProvider {
64 63
 
65 64
     /**
66 65
      * {@inheritdoc}
Please login to merge, or discard this patch.
src/Http/RequestData.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * @class RequestData
55 55
  * @package Platine\Framework\Http
56 56
  */
57
-class RequestData
58
-{
57
+class RequestData {
59 58
 
60 59
     /**
61 60
      * The request body or post data
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
      * Create new instance
92 91
      * @param ServerRequestInterface $request
93 92
      */
94
-    public function __construct(ServerRequestInterface $request)
95
-    {
93
+    public function __construct(ServerRequestInterface $request) {
96 94
         $this->posts = (array) $request->getParsedBody();
97 95
         $this->gets = $request->getQueryParams();
98 96
         $this->servers = $request->getServerParams();
@@ -154,8 +152,7 @@  discard block
 block discarded – undo
154 152
      *
155 153
      * @return mixed
156 154
      */
157
-    public function get(string $key, $default = null)
158
-    {
155
+    public function get(string $key, $default = null) {
159 156
         $gets = $this->applyInputClean($this->gets);
160 157
         return Arr::get($gets, $key, $default);
161 158
     }
@@ -167,8 +164,7 @@  discard block
 block discarded – undo
167 164
      *
168 165
      * @return mixed
169 166
      */
170
-    public function post(string $key, $default = null)
171
-    {
167
+    public function post(string $key, $default = null) {
172 168
         $posts = $this->applyInputClean($this->posts);
173 169
         return Arr::get($posts, $key, $default);
174 170
     }
@@ -180,8 +176,7 @@  discard block
 block discarded – undo
180 176
      *
181 177
      * @return mixed
182 178
      */
183
-    public function server(string $key, $default = null)
184
-    {
179
+    public function server(string $key, $default = null) {
185 180
         $servers = $this->applyInputClean($this->servers);
186 181
         return Arr::get($servers, $key, $default);
187 182
     }
@@ -193,8 +188,7 @@  discard block
 block discarded – undo
193 188
      *
194 189
      * @return mixed
195 190
      */
196
-    public function cookie(string $key, $default = null)
197
-    {
191
+    public function cookie(string $key, $default = null) {
198 192
         $cookies = $this->applyInputClean($this->cookies);
199 193
         return Arr::get($cookies, $key, $default);
200 194
     }
@@ -204,8 +198,7 @@  discard block
 block discarded – undo
204 198
      * @param mixed $str
205 199
      * @return mixed
206 200
      */
207
-    protected function cleanInput($str)
208
-    {
201
+    protected function cleanInput($str) {
209 202
         if (is_array($str)) {
210 203
             return array_map([$this, 'cleanInput'], $str);
211 204
         }
Please login to merge, or discard this patch.
src/Demo/Action/Permission/CreateAction.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -132,8 +132,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Demo/Action/Permission/EditAction.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Demo/Action/Permission/ListAction.php 3 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -107,17 +107,17 @@
 block discarded – undo
107 107
 
108 108
         ////////// BEGIN PAGINATION //////////////////
109 109
         $totalItems = $this->permissionRepository->query()
110
-                                                 ->count('id');
110
+                                                    ->count('id');
111 111
         $currentPage = (int)$param->get('page', 1);
112 112
         $this->pagination->setTotalItems($totalItems)
113
-                         ->setCurrentPage($currentPage);
113
+                            ->setCurrentPage($currentPage);
114 114
         $limit = $this->pagination->getItemsPerPage();
115 115
         $offset = $this->pagination->getOffset();
116 116
         ////////// END PAGINATION //////////////////
117 117
 
118 118
         $permissions = $this->permissionRepository->limit($offset, $limit)
119
-                                                  ->orderBy('code')
120
-                                                  ->all();
119
+                                                    ->orderBy('code')
120
+                                                    ->all();
121 121
         return new TemplateResponse(
122 122
             $this->template,
123 123
             'permission/list',
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
         ////////// BEGIN PAGINATION //////////////////
109 109
         $totalItems = $this->permissionRepository->query()
110 110
                                                  ->count('id');
111
-        $currentPage = (int)$param->get('page', 1);
111
+        $currentPage = (int) $param->get('page', 1);
112 112
         $this->pagination->setTotalItems($totalItems)
113 113
                          ->setCurrentPage($currentPage);
114 114
         $limit = $this->pagination->getItemsPerPage();
Please login to merge, or discard this patch.
src/Demo/Action/Permission/BatchAction.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@
 block discarded – undo
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')
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.