Passed
Push — master ( 7509be...6b2901 )
by Bruno
05:47
created
Modelarium/Frontend/FrontendVueGenerator.php 1 patch
Spacing   +12 added lines, -12 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
                 }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                 Button::TYPE => ($hasVueRouter ? 'router-link' : 'a'),
95 95
                 Button::ATTRIBUTES => [
96 96
                     $targetAttribute => "/{$routeBase}/edit",
97
-                ] + ($hasCan ? [ "v-if" => 'can.create' ]: []),
97
+                ] + ($hasCan ? ["v-if" => 'can.create'] : []),
98 98
             ]
99 99
         )->setContent(
100 100
             '<i class="fa fa-plus"></i> Add new',
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                 Button::TYPE => ($hasVueRouter ? 'router-link' : 'a'),
109 109
                 Button::ATTRIBUTES => [
110 110
                     $targetAttribute => "'/{$routeBase}/' + model.{$keyAttribute} + '/edit'",
111
-                ] + ($hasCan ? [ "v-if" => 'can.edit' ]: []),
111
+                ] + ($hasCan ? ["v-if" => 'can.edit'] : []),
112 112
             ]
113 113
         )->setContent(
114 114
             '<i class="fa fa-pencil"></i> Edit',
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 Button::ATTRIBUTES => [
125 125
                     'href' => '#',
126 126
                     '@click.prevent' => 'remove',
127
-                ] + ($hasCan ? [ "v-if" => 'can.delete' ]: []),
127
+                ] + ($hasCan ? ["v-if" => 'can.delete'] : []),
128 128
             ]
129 129
         )->setContent(
130 130
             '<i class="fa fa-trash"></i> Delete',
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
         $this->generator->templateParameters['buttonDelete'] = $buttonDelete;
138 138
 
139 139
         $this->generator->templateParameters['tableItemFields'] =
140
-            array_values(array_map(function (Field $f) {
140
+            array_values(array_map(function(Field $f) {
141 141
                 if ($f->getDatatype()->getBasetype() === 'relationship') {
142 142
                     $name = $f->getName();
143 143
                     return "<{$name}-link v-bind=\"{$name}\"></{$name}-link>";
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                 'required' => true
223 223
             ]
224 224
         ];
225
-        $cardFieldNames = array_map(function (Field $f) {
225
+        $cardFieldNames = array_map(function(Field $f) {
226 226
             return $f->getName();
227 227
         }, $this->generator->getCardFields());
228 228
         $vueCode->setExtraProps($extraprops);
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
             ]
251 251
         ];
252 252
         $vueCode->setExtraProps($extraprops);
253
-        $cardFieldNames = array_map(function (Field $f) {
253
+        $cardFieldNames = array_map(function(Field $f) {
254 254
             return $f->getName();
255 255
         }, $this->generator->getCardFields());
256 256
         foreach ($this->generator->getCardFields() as $f) {
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     public function vueTableItem(FrameworkVue $vue): void
276 276
     {
277 277
         $vueCode = $vue->getVueCode();
278
-        $tableFieldNames = array_map(function (Field $f) {
278
+        $tableFieldNames = array_map(function(Field $f) {
279 279
             return $f->getName();
280 280
         }, $this->generator->getTableFields());
281 281
         $extraprops = [
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
         if ($mode == 'editable') {
319 319
             $vue->setEditableTemplate(
320
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
320
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
321 321
                     return $this->generator->templateCallback($stub, $vue, $data, $m);
322 322
                 }
323 323
             );
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
             );
332 332
         } else {
333 333
             $vue->setViewableTemplate(
334
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
334
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
335 335
                     return $this->generator->templateCallback($stub, $vue, $data, $m);
336 336
                 }
337 337
             );
@@ -363,14 +363,14 @@  discard block
 block discarded – undo
363 363
         ];
364 364
 
365 365
         $import = array_map(
366
-            function ($i) use ($name) {
366
+            function($i) use ($name) {
367 367
                 return "import {$name}$i from './{$name}$i.vue';";
368 368
             },
369 369
             $items
370 370
         );
371 371
 
372 372
         $export = array_map(
373
-            function ($i) use ($name) {
373
+            function($i) use ($name) {
374 374
                 return "    {$name}$i,";
375 375
             },
376 376
             $items
Please login to merge, or discard this patch.
Modelarium/Util.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
      */
48 48
     public static function scalars(array $datatypes, string $ns): array
49 49
     {
50
-        $graphql = [ '# File automatically generated by Modelarium' ];
50
+        $graphql = ['# File automatically generated by Modelarium'];
51 51
 
52 52
         foreach ($datatypes as $name) {
53 53
             $typeName = Str::studly($name);
Please login to merge, or discard this patch.