Passed
Push — master ( d452e9...4e6115 )
by Bruno
07:41 queued 03:24
created
Modelarium/Laravel/Directives/ModelExtendsDirective.php 2 patches
Switch Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -26,9 +26,9 @@
 block discarded – undo
26 26
             $value = $arg->value->value;
27 27
 
28 28
             switch ($arg->name->value) {
29
-                case 'class':
30
-                    $generator->parentClassName = $value;
31
-                break;
29
+            case 'class':
30
+                $generator->parentClassName = $value;
31
+            break;
32 32
             }
33 33
         }
34 34
     }
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
     public static function processModelFieldDirective(
17 17
         ModelGenerator $generator,
18 18
         \GraphQL\Type\Definition\FieldDefinition $field,
19
-       \Formularium\Field $fieldFormularium,
19
+        \Formularium\Field $fieldFormularium,
20 20
         \GraphQL\Language\AST\DirectiveNode $directive
21 21
     ): void {
22 22
         foreach ($directive->arguments as $arg) {
Please login to merge, or discard this patch.
Modelarium/Laravel/Directives/MigrationTimestampsDirective.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
         MigrationGenerator $generator,
15 15
         \GraphQL\Language\AST\DirectiveNode $directive
16 16
     ): void {
17
-        $generator->createCode[] ='$table->timestamps();';
17
+        $generator->createCode[] = '$table->timestamps();';
18 18
     }
19 19
 
20 20
     public static function processMigrationFieldDirective(
Please login to merge, or discard this patch.
Modelarium/Laravel/Directives/MigrationSpatialIndexDirective.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         \GraphQL\Language\AST\DirectiveNode $directive
16 16
     ): void {
17 17
         /** @phpstan-ignore-next-line */
18
-        $generator->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value .'");';
18
+        $generator->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");';
19 19
     }
20 20
 
21 21
     public static function processMigrationFieldDirective(
Please login to merge, or discard this patch.
Modelarium/Laravel/Directives/MorphedByManyDirective.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
              * @var ObjectType $object
62 62
              */
63 63
 
64
-            if (str_starts_with((string)$name, '__')) {
64
+            if (str_starts_with((string) $name, '__')) {
65 65
                 // internal type
66 66
                 continue;
67 67
             }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                     continue;
74 74
                 }
75 75
 
76
-                $methodName = $generator->getInflector()->pluralize(mb_strtolower((string)$name));
76
+                $methodName = $generator->getInflector()->pluralize(mb_strtolower((string) $name));
77 77
                 $generator->class->addMethod($methodName)
78 78
                         ->setReturnType('\\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany')
79 79
                         ->setPublic()
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
     public static function processModelFieldDirective(
37 37
         ModelGenerator $generator,
38 38
         \GraphQL\Type\Definition\FieldDefinition $field,
39
-       \Formularium\Field $fieldFormularium,
39
+        \Formularium\Field $fieldFormularium,
40 40
         \GraphQL\Language\AST\DirectiveNode $directive
41 41
     ): void {
42 42
         // nothing
Please login to merge, or discard this patch.
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
 
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                 $vue,
175 175
                 'Form',
176 176
                 'editable',
177
-                function (Field $f) {
177
+                function(Field $f) {
178 178
                     if (!$f->getExtradata('modelFillable')) {
179 179
                         return false;
180 180
                     }
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
         $hasVue = $this->composer->getByName('Vue');
245 245
 
246 246
         $this->cardFields = $this->model->filterField(
247
-            function (Field $field) {
247
+            function(Field $field) {
248 248
                 return $field->getRenderable('card', false);
249 249
             }
250 250
         );
251 251
         $this->tableFields = $this->model->filterField(
252
-            function (Field $field) {
252
+            function(Field $field) {
253 253
                 return $field->getRenderable('table', false);
254 254
             }
255 255
         );
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
                 Button::TYPE => 'a',
261 261
                 Button::ATTRIBUTES => [
262 262
                     'href' => "/{$this->routeBase}/edit"
263
-                ] + ($hasVue ? [ "v-if" => 'can.create' ]: []),
263
+                ] + ($hasVue ? ["v-if" => 'can.create'] : []),
264 264
             ]
265 265
         )->setContent(
266 266
             '<i class="fa fa-plus"></i> Add new',
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
                 Button::TYPE => ($hasVue ? 'router-link' : 'a'),
275 275
                 Button::ATTRIBUTES => [
276 276
                     ':to' => "'/{$this->lowerName}/' + model.{$this->keyAttribute} + '/edit'"
277
-                ] + ($hasVue ? [ "v-if" => 'can.edit' ]: []),
277
+                ] + ($hasVue ? ["v-if" => 'can.edit'] : []),
278 278
             ]
279 279
         )->setContent(
280 280
             '<i class="fa fa-pencil"></i> Edit',
@@ -290,7 +290,7 @@  discard block
 block discarded – undo
290 290
                 Button::ATTRIBUTES => [
291 291
                     'href' => '#',
292 292
                     '@click.prevent' => 'remove'
293
-                ] + ($hasVue ? [ "v-if" => 'can.delete' ]: []),
293
+                ] + ($hasVue ? ["v-if" => 'can.delete'] : []),
294 294
             ]
295 295
         )->setContent(
296 296
             '<i class="fa fa-trash"></i> Delete',
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             'Table',
306 306
             [
307 307
                 Table::ROW_NAMES => array_map(
308
-                    function (Field $field) {
308
+                    function(Field $field) {
309 309
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
310 310
                     },
311 311
                     $this->tableFields
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             true
324 324
         );
325 325
         $titleFields = $this->model->filterField(
326
-            function (Field $field) {
326
+            function(Field $field) {
327 327
                 return $field->getRenderable('title', false);
328 328
             }
329 329
         );
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
             'keyAttribute' => $this->keyAttribute,
350 350
             'spinner' => $spinner,
351 351
             'tablelist' => $table->getRenderHTML(),
352
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
352
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
353 353
                 return $f->getName();
354 354
             }, $this->tableFields)),
355 355
             'typeTitle' => $this->studlyName,
@@ -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
             );
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
          * card
489 489
          */
490 490
         $cardFieldNames = array_map(
491
-            function (Field $field) {
491
+            function(Field $field) {
492 492
                 return $field->getName();
493 493
             },
494 494
             $this->cardFields
@@ -501,8 +501,8 @@  discard block
 block discarded – undo
501 501
             $filtersQuery = ', ' . join(
502 502
                 ', ',
503 503
                 array_map(
504
-                    function ($item) {
505
-                        return '$' . $item['name']  . ': ' . $item['type'] . ($item['required'] ? '!' : '');
504
+                    function($item) {
505
+                        return '$' . $item['name'] . ': ' . $item['type'] . ($item['required'] ? '!' : '');
506 506
                     },
507 507
                     $filters
508 508
                 )
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
             $filtersParams = ', ' . join(
511 511
                 ', ',
512 512
                 array_map(
513
-                    function ($item) {
513
+                    function($item) {
514 514
                         return $item['name'] . ': $' . $item['name'];
515 515
                     },
516 516
                     $filters
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
          * table
550 550
          */
551 551
         $tableFieldNames = array_map(
552
-            function (Field $field) {
552
+            function(Field $field) {
553 553
                 return $field->getName();
554 554
             },
555 555
             $this->tableFields
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
          * item
586 586
          */
587 587
         $graphqlQuery = $this->model->mapFields(
588
-            function (Field $f) {
588
+            function(Field $f) {
589 589
                 return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null;
590 590
             }
591 591
         );
@@ -662,14 +662,14 @@  discard block
 block discarded – undo
662 662
         ];
663 663
 
664 664
         $import = array_map(
665
-            function ($i) use ($name) {
665
+            function($i) use ($name) {
666 666
                 return "import {$name}$i from './{$name}$i.vue';";
667 667
             },
668 668
             $items
669 669
         );
670 670
 
671 671
         $export = array_map(
672
-            function ($i) use ($name) {
672
+            function($i) use ($name) {
673 673
                 return "    {$name}$i,\n";
674 674
             },
675 675
             $items
Please login to merge, or discard this patch.
Modelarium/Modelarium.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     public static function getGeneratorDirectiveNamespaces(): array
37 37
     {
38 38
         return array_map(
39
-            function ($i) {
39
+            function($i) {
40 40
                 return $i . '\\Laravel\\Directives';
41 41
             },
42 42
             self::$directiveLaravelLibraries
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     public static function getGeneratorLighthouseDirectiveNamespaces(): array
52 52
     {
53 53
         return array_map(
54
-            function ($i) {
54
+            function($i) {
55 55
                 return $i . '\\Laravel\\Lighthouse\\Directives';
56 56
             },
57 57
             self::$directiveLaravelLibraries
Please login to merge, or discard this patch.
Modelarium/Laravel/Datatypes/Datatype_relationship.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                 $graphqlQuery = array_merge(
84 84
                     $graphqlQuery,
85 85
                     $formulariumModel->mapFields(
86
-                        function (Field $f) use ($recurseLevel) {
86
+                        function(Field $f) use ($recurseLevel) {
87 87
                             $type = $f->getDatatype();
88 88
                             if ($type instanceof Datatype_relationship && !$type->getIsInverse()) {
89 89
                                 return '';
@@ -100,8 +100,8 @@  discard block
 block discarded – undo
100 100
              */
101 101
             $formulariumModel = call_user_func("$model::getFormularium"); /** @phpstan-ignore-line */
102 102
             $graphqlQuery = $formulariumModel->mapFields(
103
-                function (Field $f) use ($recurseLevel) {
104
-                    return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery([self::RECURSE => $recurseLevel-1]) : null;
103
+                function(Field $f) use ($recurseLevel) {
104
+                    return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery([self::RECURSE => $recurseLevel - 1]) : null;
105 105
                 }
106 106
             );
107 107
             array_unshift($graphqlQuery, 'id');
Please login to merge, or discard this patch.
Modelarium/Laravel/Directives/RenderableDirective.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public static function processModelFieldDirective(
26 26
         ModelGenerator $generator,
27 27
         \GraphQL\Type\Definition\FieldDefinition $field,
28
-       \Formularium\Field $fieldFormularium,
28
+        \Formularium\Field $fieldFormularium,
29 29
         \GraphQL\Language\AST\DirectiveNode $directive
30 30
     ): void {
31 31
         // handled by FormulariumUtils::getFieldFromDirectives()
Please login to merge, or discard this patch.
Modelarium/Laravel/Directives/ModelNotifiableDirective.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
     public static function processModelFieldDirective(
18 18
         ModelGenerator $generator,
19 19
         \GraphQL\Type\Definition\FieldDefinition $field,
20
-       \Formularium\Field $fieldFormularium,
20
+        \Formularium\Field $fieldFormularium,
21 21
         \GraphQL\Language\AST\DirectiveNode $directive
22 22
     ): void {
23 23
     }
Please login to merge, or discard this patch.