Passed
Push — master ( 450d12...f65752 )
by Bruno
07:03
created
Modelarium/Frontend/FrontendVueGenerator.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                 Button::TYPE => ($hasVueRouter ? 'router-link' : 'a'),
137 137
                 Button::ATTRIBUTES => [
138 138
                     $targetAttribute => "/{$routeBase}/edit",
139
-                ] + ($hasCan ? [ "v-if" => 'can(\'create\')' ]: []),
139
+                ] + ($hasCan ? ["v-if" => 'can(\'create\')'] : []),
140 140
             ]
141 141
         )->setContent(
142 142
             '<i class="fa fa-plus"></i> Add new',
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                 Button::TYPE => ($hasVueRouter ? 'router-link' : 'a'),
151 151
                 Button::ATTRIBUTES => [
152 152
                     $targetAttribute => "'/{$routeBase}/' + model.{$keyAttribute} + '/edit'",
153
-                ] + ($hasCan ? [ "v-if" => 'can(\'edit\')' ]: []),
153
+                ] + ($hasCan ? ["v-if" => 'can(\'edit\')'] : []),
154 154
             ]
155 155
         )->setContent(
156 156
             '<i class="fa fa-pencil"></i> Edit',
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                 Button::ATTRIBUTES => [
167 167
                     'href' => '#',
168 168
                     '@click.prevent' => 'remove',
169
-                ] + ($hasCan ? [ "v-if" => 'can(\'delete\')' ]: []),
169
+                ] + ($hasCan ? ["v-if" => 'can(\'delete\')'] : []),
170 170
             ]
171 171
         )->setContent(
172 172
             '<i class="fa fa-trash"></i> Delete',
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $this->generator->templateParameters['options'] = $this->getOptions()->getSection('vue');
187 187
 
188 188
         $this->generator->templateParameters['tableItemFields'] =
189
-            array_values(array_map(function (Field $f) {
189
+            array_values(array_map(function(Field $f) {
190 190
                 if ($f->getDatatype()->getBasetype() === 'relationship') {
191 191
                     $name = $f->getName();
192 192
                     return "<{$name}-link v-bind=\"{$name}\"></{$name}-link>";
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                 'required' => true
282 282
             ]
283 283
         ];
284
-        $cardFieldNames = array_map(function (Field $f) {
284
+        $cardFieldNames = array_map(function(Field $f) {
285 285
             return $f->getName();
286 286
         }, $this->generator->getCardFields());
287 287
         $vueCode->setExtraProps($extraprops);
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         $vueCode = $vue->getVueCode();
308 308
         // set basic data for vue
309 309
         $vueCode->setExtraProps([]);
310
-        $cardFieldNames = array_map(function (Field $f) {
310
+        $cardFieldNames = array_map(function(Field $f) {
311 311
             return $f->getName();
312 312
         }, $this->generator->getCardFields());
313 313
         foreach ($this->generator->getCardFields() as $f) {
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
     public function vueTableItem(FrameworkVue $vue): void
341 341
     {
342 342
         $vueCode = $vue->getVueCode();
343
-        $tableFieldNames = array_map(function (Field $f) {
343
+        $tableFieldNames = array_map(function(Field $f) {
344 344
             return $f->getName();
345 345
         }, $this->generator->getTableFields());
346 346
         $vueCode->setExtraProps([]);
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
             $vue,
375 375
             'Form',
376 376
             'editable',
377
-            function (Field $f) {
377
+            function(Field $f) {
378 378
                 if (!$f->getExtradata('modelFillable')) {
379 379
                     return false;
380 380
                 }
@@ -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->generator->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->generator->templateCallback($stub, $vue, $data, $m);
418 418
                 }
419 419
             );
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
         $path = $this->generator->getModel()->getName() . '/index.js';
436 436
         $name = $this->generator->getStudlyName();
437 437
 
438
-        $contents = function ($basepath, $element) use ($name) {
438
+        $contents = function($basepath, $element) use ($name) {
439 439
             $dir = $basepath . '/' . $name;
440 440
             $import = [];
441 441
             $export = [];
Please login to merge, or discard this patch.