Passed
Push — master ( f9af91...79b8a4 )
by Bruno
06:16
created
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
         // $blade = FrameworkComposer::getByName('Blade');
88 88
 
89 89
         if ($vue !== null) {
90
-            $cardFieldNames = array_map(function (Field $f) {
90
+            $cardFieldNames = array_map(function(Field $f) {
91 91
                 return $f->getName();
92 92
             }, $this->cardFields);
93
-            $tableFieldNames = array_map(function (Field $f) {
93
+            $tableFieldNames = array_map(function(Field $f) {
94 94
                 return $f->getName();
95 95
             }, $this->tableFields);
96 96
 
@@ -142,12 +142,12 @@  discard block
 block discarded – undo
142 142
     protected function buildTemplateParameters(): void
143 143
     {
144 144
         $this->cardFields = $this->model->filterField(
145
-            function (Field $field) {
145
+            function(Field $field) {
146 146
                 return $field->getRenderable('card', false);
147 147
             }
148 148
         );
149 149
         $this->tableFields = $this->model->filterField(
150
-            function (Field $field) {
150
+            function(Field $field) {
151 151
                 return $field->getRenderable('table', false);
152 152
             }
153 153
         );
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
             'Button',
160 160
             [
161 161
                 Button::TYPE => 'a',
162
-                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit" ],
162
+                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit"],
163 163
             ]
164 164
         )->setContent(
165 165
             '<i class="fa fa-plus"></i> Add new',
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
             'Table',
203 203
             [
204 204
                 Table::ROW_NAMES => array_map(
205
-                    function (Field $field) {
205
+                    function(Field $field) {
206 206
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
207 207
                     },
208 208
                     $this->tableFields
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
             true
221 221
         );
222 222
         $titleFields = $this->model->filterField(
223
-            function (Field $field) {
223
+            function(Field $field) {
224 224
                 return $field->getRenderable('title', false);
225 225
             }
226 226
         );
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             // TODO 'hasCan' => $this->model
245 245
             'spinner' => $spinner,
246 246
             'tablelist' => $table->getRenderHTML(),
247
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
247
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
248 248
                 return $f->getName();
249 249
             }, $this->tableFields)),
250 250
             'titleField' => array_key_first($titleFields) ?: 'id'
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
         if ($mode == 'editable') {
274 274
             $vue->setEditableTemplate(
275
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
275
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
276 276
                     return $this->templateCallback($stub, $vue, $data, $m);
277 277
                 }
278 278
             );
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
             );
287 287
         } else {
288 288
             $vue->setViewableTemplate(
289
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
289
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
290 290
                     return $this->templateCallback($stub, $vue, $data, $m);
291 291
                 }
292 292
             );
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
          * card
314 314
          */
315 315
         $cardFieldNames = array_map(
316
-            function (Field $field) {
316
+            function(Field $field) {
317 317
                 return $field->getName();
318 318
             },
319 319
             $this->cardFields
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
          * table
350 350
          */
351 351
         $tableFieldNames = array_map(
352
-            function (Field $field) {
352
+            function(Field $field) {
353 353
                 return $field->getName();
354 354
             },
355 355
             $this->tableFields
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
         /*
385 385
          * item
386 386
          */
387
-        $graphqlQuery = $this->model->toGraphqlQuery();// TODO: filter !fillable, hidden
387
+        $graphqlQuery = $this->model->toGraphqlQuery(); // TODO: filter !fillable, hidden
388 388
         $itemQuery = <<<EOF
389 389
 query (\$id: ID!) {
390 390
     {$this->lowerName}(id: \$id) {
@@ -447,14 +447,14 @@  discard block
 block discarded – undo
447 447
         ];
448 448
 
449 449
         $import = array_map(
450
-            function ($i) use ($name) {
450
+            function($i) use ($name) {
451 451
                 return "import {$name}$i from './{$name}$i.vue';";
452 452
             },
453 453
             $items
454 454
         );
455 455
 
456 456
         $export = array_map(
457
-            function ($i) use ($name) {
457
+            function($i) use ($name) {
458 458
                 return "    {$name}$i,\n";
459 459
             },
460 460
             $items
Please login to merge, or discard this patch.