Passed
Push — master ( 1ff55b...d1775e )
by Bruno
08:02
created
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
         if ($vue !== null) {
121 121
             // build the fields for cards and tables
122 122
             $vueCode = $vue->getVueCode();
123
-            $cardFieldNames = array_map(function (Field $f) {
123
+            $cardFieldNames = array_map(function(Field $f) {
124 124
                 return $f->getName();
125 125
             }, $this->cardFields);
126
-            $tableFieldNames = array_map(function (Field $f) {
126
+            $tableFieldNames = array_map(function(Field $f) {
127 127
                 return $f->getName();
128 128
             }, $this->tableFields);
129 129
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                 $vue,
176 176
                 'Form',
177 177
                 'editable',
178
-                function (Field $f) {
178
+                function(Field $f) {
179 179
                     if (!$f->getExtradata('modelFillable')) {
180 180
                         return false;
181 181
                     }
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
         $hasVue = $this->composer->getByName('Vue');
246 246
 
247 247
         $this->cardFields = $this->model->filterField(
248
-            function (Field $field) {
248
+            function(Field $field) {
249 249
                 return $field->getRenderable('card', false);
250 250
             }
251 251
         );
252 252
         $this->tableFields = $this->model->filterField(
253
-            function (Field $field) {
253
+            function(Field $field) {
254 254
                 return $field->getRenderable('table', false);
255 255
             }
256 256
         );
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 Button::TYPE => 'a',
262 262
                 Button::ATTRIBUTES => [
263 263
                     'href' => "/{$this->routeBase}/edit"
264
-                ] + ($hasVue ? [ "v-if" => 'can.create' ]: []),
264
+                ] + ($hasVue ? ["v-if" => 'can.create'] : []),
265 265
             ]
266 266
         )->setContent(
267 267
             '<i class="fa fa-plus"></i> Add new',
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
                 Button::TYPE => ($hasVue ? 'router-link' : 'a'),
276 276
                 Button::ATTRIBUTES => [
277 277
                     ':to' => "'/{$this->lowerName}/' + model.{$this->keyAttribute} + '/edit'"
278
-                ] + ($hasVue ? [ "v-if" => 'can.edit' ]: []),
278
+                ] + ($hasVue ? ["v-if" => 'can.edit'] : []),
279 279
             ]
280 280
         )->setContent(
281 281
             '<i class="fa fa-pencil"></i> Edit',
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 Button::ATTRIBUTES => [
292 292
                     'href' => '#',
293 293
                     '@click.prevent' => 'remove'
294
-                ] + ($hasVue ? [ "v-if" => 'can.delete' ]: []),
294
+                ] + ($hasVue ? ["v-if" => 'can.delete'] : []),
295 295
             ]
296 296
         )->setContent(
297 297
             '<i class="fa fa-trash"></i> Delete',
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             'Table',
307 307
             [
308 308
                 Table::ROW_NAMES => array_map(
309
-                    function (Field $field) {
309
+                    function(Field $field) {
310 310
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
311 311
                     },
312 312
                     $this->tableFields
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
             true
325 325
         );
326 326
         $titleFields = $this->model->filterField(
327
-            function (Field $field) {
327
+            function(Field $field) {
328 328
                 return $field->getRenderable('title', false);
329 329
             }
330 330
         );
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
             'keyAttribute' => $this->keyAttribute,
351 351
             'spinner' => $spinner,
352 352
             'tablelist' => $table->getRenderHTML(),
353
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
353
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
354 354
                 return $f->getName();
355 355
             }, $this->tableFields)),
356 356
             'titleField' => array_key_first($titleFields) ?: 'id'
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
 
400 400
         if ($mode == 'editable') {
401 401
             $vue->setEditableTemplate(
402
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
402
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
403 403
                     return $this->templateCallback($stub, $vue, $data, $m);
404 404
                 }
405 405
             );
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             );
414 414
         } else {
415 415
             $vue->setViewableTemplate(
416
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
416
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
417 417
                     return $this->templateCallback($stub, $vue, $data, $m);
418 418
                 }
419 419
             );
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
          * card
488 488
          */
489 489
         $cardFieldNames = array_map(
490
-            function (Field $field) {
490
+            function(Field $field) {
491 491
                 return $field->getName();
492 492
             },
493 493
             $this->cardFields
@@ -500,8 +500,8 @@  discard block
 block discarded – undo
500 500
             $filtersQuery = ', ' . join(
501 501
                 ', ',
502 502
                 array_map(
503
-                    function ($item) {
504
-                        return '$' . $item['name']  . ': ' . $item['type'] . ($item['required'] ? '!' : '');
503
+                    function($item) {
504
+                        return '$' . $item['name'] . ': ' . $item['type'] . ($item['required'] ? '!' : '');
505 505
                     },
506 506
                     $filters
507 507
                 )
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
             $filtersParams = ', ' . join(
510 510
                 ', ',
511 511
                 array_map(
512
-                    function ($item) {
512
+                    function($item) {
513 513
                         return $item['name'] . ': $' . $item['name'];
514 514
                     },
515 515
                     $filters
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
          * table
549 549
          */
550 550
         $tableFieldNames = array_map(
551
-            function (Field $field) {
551
+            function(Field $field) {
552 552
                 return $field->getName();
553 553
             },
554 554
             $this->tableFields
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
          * item
585 585
          */
586 586
         $graphqlQuery = $this->model->mapFields(
587
-            function (Field $f) {
587
+            function(Field $f) {
588 588
                 return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null;
589 589
             }
590 590
         );
@@ -661,14 +661,14 @@  discard block
 block discarded – undo
661 661
         ];
662 662
 
663 663
         $import = array_map(
664
-            function ($i) use ($name) {
664
+            function($i) use ($name) {
665 665
                 return "import {$name}$i from './{$name}$i.vue';";
666 666
             },
667 667
             $items
668 668
         );
669 669
 
670 670
         $export = array_map(
671
-            function ($i) use ($name) {
671
+            function($i) use ($name) {
672 672
                 return "    {$name}$i,\n";
673 673
             },
674 674
             $items
Please login to merge, or discard this patch.