Passed
Push — master ( ee41eb...972703 )
by Bruno
03:32
created
Modelarium/Laravel/Targets/ModelGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -233,7 +233,7 @@
 block discarded – undo
233 233
             $this->fModel->appendExtradata(
234 234
                 new Extradata(
235 235
                     'hasCan',
236
-                    [ new ExtradataParameter('value', true) ]
236
+                    [new ExtradataParameter('value', true)]
237 237
                 )
238 238
             );
239 239
             return;
Please login to merge, or discard this patch.
Modelarium/Frontend/FrontendVueGenerator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
             $vue,
70 70
             'Form',
71 71
             'editable',
72
-            function (Field $f) {
72
+            function(Field $f) {
73 73
                 if (!$f->getExtradata('modelFillable')) {
74 74
                     return false;
75 75
                 }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
                 Button::TYPE => ($hasVuex ? 'router-link' : 'a'),
94 94
                 Button::ATTRIBUTES => [
95 95
                     $targetAttribute => "/{$routeBase}/edit",
96
-                ] + ($hasCan ? [ "v-if" => 'can.create' ]: []),
96
+                ] + ($hasCan ? ["v-if" => 'can.create'] : []),
97 97
             ]
98 98
         )->setContent(
99 99
             '<i class="fa fa-plus"></i> Add new',
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                 Button::TYPE => ($hasVuex ? 'router-link' : 'a'),
108 108
                 Button::ATTRIBUTES => [
109 109
                     $targetAttribute => "'/{$routeBase}/' + model.{$keyAttribute} + '/edit'",
110
-                ] + ($hasCan ? [ "v-if" => 'can.edit' ]: []),
110
+                ] + ($hasCan ? ["v-if" => 'can.edit'] : []),
111 111
             ]
112 112
         )->setContent(
113 113
             '<i class="fa fa-pencil"></i> Edit',
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
                 Button::ATTRIBUTES => [
124 124
                     'href' => '#',
125 125
                     '@click.prevent' => 'remove',
126
-                ] + ($hasCan ? [ "v-if" => 'can.delete' ]: []),
126
+                ] + ($hasCan ? ["v-if" => 'can.delete'] : []),
127 127
             ]
128 128
         )->setContent(
129 129
             '<i class="fa fa-trash"></i> Delete',
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                 'required' => true
213 213
             ]
214 214
         ];
215
-        $cardFieldNames = array_map(function (Field $f) {
215
+        $cardFieldNames = array_map(function(Field $f) {
216 216
             return $f->getName();
217 217
         }, $this->generator->getCardFields());
218 218
         $vueCode->setExtraProps($extraprops);
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
             ]
241 241
         ];
242 242
         $vueCode->setExtraProps($extraprops);
243
-        $cardFieldNames = array_map(function (Field $f) {
243
+        $cardFieldNames = array_map(function(Field $f) {
244 244
             return $f->getName();
245 245
         }, $this->generator->getCardFields());
246 246
         foreach ($this->generator->getCardFields() as $f) {
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     public function vueTableItem(FrameworkVue $vue): void
258 258
     {
259 259
         $vueCode = $vue->getVueCode();
260
-        $tableFieldNames = array_map(function (Field $f) {
260
+        $tableFieldNames = array_map(function(Field $f) {
261 261
             return $f->getName();
262 262
         }, $this->generator->getTableFields());
263 263
         $extraprops = [
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
         if ($mode == 'editable') {
301 301
             $vue->setEditableTemplate(
302
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
302
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
303 303
                     return $this->generator->templateCallback($stub, $vue, $data, $m);
304 304
                 }
305 305
             );
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
             );
314 314
         } else {
315 315
             $vue->setViewableTemplate(
316
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
316
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
317 317
                     return $this->generator->templateCallback($stub, $vue, $data, $m);
318 318
                 }
319 319
             );
@@ -345,14 +345,14 @@  discard block
 block discarded – undo
345 345
         ];
346 346
 
347 347
         $import = array_map(
348
-            function ($i) use ($name) {
348
+            function($i) use ($name) {
349 349
                 return "import {$name}$i from './{$name}$i.vue';";
350 350
             },
351 351
             $items
352 352
         );
353 353
 
354 354
         $export = array_map(
355
-            function ($i) use ($name) {
355
+            function($i) use ($name) {
356 356
                 return "    {$name}$i,\n";
357 357
             },
358 358
             $items
Please login to merge, or discard this patch.
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
     public function buildTemplateParameters(): void
134 134
     {
135 135
         $this->cardFields = $this->fModel->filterField(
136
-            function (Field $field) {
136
+            function(Field $field) {
137 137
                 return $field->getRenderable('card', false);
138 138
             }
139 139
         );
140 140
         $this->tableFields = $this->fModel->filterField(
141
-            function (Field $field) {
141
+            function(Field $field) {
142 142
                 return $field->getRenderable('table', false);
143 143
             }
144 144
         );
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             'Table',
195 195
             [
196 196
                 Table::ROW_NAMES => array_map(
197
-                    function (Field $field) {
197
+                    function(Field $field) {
198 198
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
199 199
                     },
200 200
                     $this->tableFields
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             true
213 213
         );
214 214
         $titleFields = $this->fModel->filterField(
215
-            function (Field $field) {
215
+            function(Field $field) {
216 216
                 return $field->getRenderable('title', false);
217 217
             }
218 218
         );
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
             'keyAttribute' => $this->keyAttribute,
240 240
             'spinner' => $spinner,
241 241
             'tablelist' => $table->getRenderHTML(),
242
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
242
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
243 243
                 return $f->getName();
244 244
             }, $this->tableFields)),
245 245
             'typeTitle' => $this->studlyName,
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
          * card
318 318
          */
319 319
         $cardFieldNames = array_map(
320
-            function (Field $field) {
320
+            function(Field $field) {
321 321
                 return $field->getName();
322 322
             },
323 323
             $this->cardFields
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
             $filtersQuery = ', ' . join(
331 331
                 ', ',
332 332
                 array_map(
333
-                    function ($item) {
334
-                        return '$' . $item['name']  . ': ' . $item['type'] . ($item['required'] ? '!' : '');
333
+                    function($item) {
334
+                        return '$' . $item['name'] . ': ' . $item['type'] . ($item['required'] ? '!' : '');
335 335
                     },
336 336
                     $filters
337 337
                 )
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
             $filtersParams = ', ' . join(
340 340
                 ', ',
341 341
                 array_map(
342
-                    function ($item) {
342
+                    function($item) {
343 343
                         return $item['name'] . ': $' . $item['name'];
344 344
                     },
345 345
                     $filters
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
          * table
379 379
          */
380 380
         $tableFieldNames = array_map(
381
-            function (Field $field) {
381
+            function(Field $field) {
382 382
                 return $field->getName();
383 383
             },
384 384
             $this->tableFields
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
          * item
415 415
          */
416 416
         $graphqlQuery = $this->fModel->mapFields(
417
-            function (Field $f) {
417
+            function(Field $f) {
418 418
                 return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null;
419 419
             }
420 420
         );
Please login to merge, or discard this patch.