Passed
Push — master ( c6f3bf...7f6d98 )
by Bruno
14:25 queued 04:21
created
Modelarium/Laravel/Lighthouse/Directives/MinLengthDirective.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
         $previousResolver = $fieldValue->getResolver();
44 44
 
45 45
         // Wrap around the resolver
46
-        $wrappedResolver = function ($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string {
46
+        $wrappedResolver = function($root, array $args, GraphQLContext $context, ResolveInfo $info) use ($previousResolver): string {
47 47
             // Call the resolver, passing along the resolver arguments
48 48
             /** @var string $result */
49 49
             $result = $previousResolver($root, $args, $context, $info);
Please login to merge, or discard this patch.
Modelarium/Datatypes/Datatype_relationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     /**
32 32
      * @var string
33 33
      */
34
-    protected $targetClass= '';
34
+    protected $targetClass = '';
35 35
 
36 36
     /**
37 37
      * If false, $source is "User" (class with HasOne/HasMany posts())
Please login to merge, or discard this patch.
Modelarium/Datatypes/RelationshipFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
     public const RELATIONSHIP = "RELATIONSHIP";
17 17
     public const RELATIONSHIP_ONE_TO_ONE = "11";
18 18
     public const RELATIONSHIP_ONE_TO_MANY = "1N";
19
-    public const RELATIONSHIP_MANY_TO_MANY  = "NN";
19
+    public const RELATIONSHIP_MANY_TO_MANY = "NN";
20 20
     public const MORPH_ONE_TO_ONE = "M11";
21 21
     public const MORPH_ONE_TO_MANY = "M1N";
22
-    public const MORPH_MANY_TO_MANY  = "MNN";
22
+    public const MORPH_MANY_TO_MANY = "MNN";
23 23
 
24 24
     private function __construct()
25 25
     {
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             if (!in_array($matches['mode'], $relationships)) {
52 52
                 throw new ClassNotFoundException('Invalid relationship');
53 53
             }
54
-            return static::factory($matches['source'], $matches['target'], $matches['mode'], (bool)$matches['inverse']);
54
+            return static::factory($matches['source'], $matches['target'], $matches['mode'], (bool) $matches['inverse']);
55 55
         }
56 56
         throw new ClassNotFoundException('Invalid relationship');
57 57
     }
Please login to merge, or discard this patch.
util/MakeAPIDoc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 function datatypes()
10 10
 {
11 11
     $markdown = DatatypeFactory::map(
12
-        function (\ReflectionClass $reflection): array {
12
+        function(\ReflectionClass $reflection): array {
13 13
             $class = $reflection->getName();
14 14
     
15 15
             /**
Please login to merge, or discard this patch.
Modelarium/Laravel/Console/Commands/ModelariumScaffoldCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $files = $processor->getCollection();
92 92
         if ($name && $name !== '*' && $name !== 'all') {
93 93
             $files = $files->filter(
94
-                function (GeneratedItem $g) use ($name) {
94
+                function(GeneratedItem $g) use ($name) {
95 95
                     if (is_array($name)) {
96 96
                         throw new \Exception('Arrays not supported yet');
97 97
                     } else {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $this->writeFiles(
105 105
             $files,
106 106
             base_path(),
107
-            (bool)$this->option('overwrite')
107
+            (bool) $this->option('overwrite')
108 108
         );
109 109
         $this->info('Finished scaffolding. You might want to run `composer dump-autoload`');
110 110
     }
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/SeedGenerator.php 2 patches
Switch Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,17 +54,17 @@
 block discarded – undo
54 54
         foreach ($directives as $directive) {
55 55
             $name = $directive->name->value;
56 56
             switch ($name) {
57
-                case 'belongsToMany':
58
-                    $type1 = $this->lowerName;
59
-                    $type2 = $lowerName;
60
-                    if (strcasecmp($type1, $type2) < 0) { // TODO: check this, might not work
61
-                        $relationship = mb_strtolower($this->getInflector()->pluralize($field->name));
62
-                        $this->extraCode[] = $this->makeManyToManySeed($type1, $type2, $relationship);
63
-                    }
64
-                break;
65
-                case 'morphedByMany':
66
-                    // TODO $relation = Parser::getDirectiveArgumentByName($directive, 'relation', $lowerName);
67
-                break;
57
+            case 'belongsToMany':
58
+                $type1 = $this->lowerName;
59
+                $type2 = $lowerName;
60
+                if (strcasecmp($type1, $type2) < 0) { // TODO: check this, might not work
61
+                    $relationship = mb_strtolower($this->getInflector()->pluralize($field->name));
62
+                    $this->extraCode[] = $this->makeManyToManySeed($type1, $type2, $relationship);
63
+                }
64
+            break;
65
+            case 'morphedByMany':
66
+                // TODO $relation = Parser::getDirectiveArgumentByName($directive, 'relation', $lowerName);
67
+            break;
68 68
             default:
69 69
             break;
70 70
             }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         }
39 39
 
40 40
         return new GeneratedCollection(
41
-            [ new GeneratedItem(
41
+            [new GeneratedItem(
42 42
                 GeneratedItem::TYPE_SEED,
43 43
                 $this->generateString(),
44 44
                 $this->getGenerateFilename()
@@ -101,6 +101,6 @@  discard block
 block discarded – undo
101 101
 
102 102
     public function getGenerateFilename(): string
103 103
     {
104
-        return $this->getBasePath('database/seeds/'. $this->studlyName . 'Seeder.php');
104
+        return $this->getBasePath('database/seeds/' . $this->studlyName . 'Seeder.php');
105 105
     }
106 106
 }
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/ModelGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
                      * @var ObjectType $object
315 315
                      */
316 316
 
317
-                    if (str_starts_with((string)$name, '__')) {
317
+                    if (str_starts_with((string) $name, '__')) {
318 318
                         // internal type
319 319
                         continue;
320 320
                     }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                             continue;
327 327
                         }
328 328
 
329
-                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name));
329
+                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name));
330 330
                         $this->class->addMethod($methodName)
331 331
                                 ->setReturnType('\\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany')
332 332
                                 ->setPublic()
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
             } else {
355 355
                 $this->methodRandom->addBody(
356 356
                     '$data["' . $lowerName . '_id"] = function () {' . "\n" .
357
-                '    return factory(' . $targetClass . '::class)->create()->id;'  . "\n" .
357
+                '    return factory(' . $targetClass . '::class)->create()->id;' . "\n" .
358 358
                 '};'
359 359
                 );
360 360
             }
Please login to merge, or discard this patch.
Modelarium/Frontend/Vue/Renderable/Renderable_relationship.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
         // get the title field
70 70
         $titleField = $targetModel->firstField(
71
-            function (Field $field) {
71
+            function(Field $field) {
72 72
                 return $field->getRenderable('title', false);
73 73
             }
74 74
         );
Please login to merge, or discard this patch.
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
         // $blade = FrameworkComposer::getByName('Blade');
87 87
 
88 88
         if ($vue !== null) {
89
-            $cardFieldNames = array_map(function (Field $f) {
89
+            $cardFieldNames = array_map(function(Field $f) {
90 90
                 return $f->getName();
91 91
             }, $this->cardFields);
92
-            $tableFieldNames = array_map(function (Field $f) {
92
+            $tableFieldNames = array_map(function(Field $f) {
93 93
                 return $f->getName();
94 94
             }, $this->tableFields);
95 95
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 $vue,
115 115
                 'Form',
116 116
                 'editable',
117
-                function (Field $f) {
117
+                function(Field $f) {
118 118
                     if (!$f->getExtradata('modelFillable')) {
119 119
                         return false;
120 120
                     }
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
     protected function buildTemplateParameters(): void
178 178
     {
179 179
         $this->cardFields = $this->model->filterField(
180
-            function (Field $field) {
180
+            function(Field $field) {
181 181
                 return $field->getRenderable('card', false);
182 182
             }
183 183
         );
184 184
         $this->tableFields = $this->model->filterField(
185
-            function (Field $field) {
185
+            function(Field $field) {
186 186
                 return $field->getRenderable('table', false);
187 187
             }
188 188
         );
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             'Button',
195 195
             [
196 196
                 Button::TYPE => 'a',
197
-                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit" ],
197
+                Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit"],
198 198
             ]
199 199
         )->setContent(
200 200
             '<i class="fa fa-plus"></i> Add new',
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             'Table',
238 238
             [
239 239
                 Table::ROW_NAMES => array_map(
240
-                    function (Field $field) {
240
+                    function(Field $field) {
241 241
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
242 242
                     },
243 243
                     $this->tableFields
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
             true
256 256
         );
257 257
         $titleFields = $this->model->filterField(
258
-            function (Field $field) {
258
+            function(Field $field) {
259 259
                 return $field->getRenderable('title', false);
260 260
             }
261 261
         );
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             // TODO 'hasCan' => $this->model
280 280
             'spinner' => $spinner,
281 281
             'tablelist' => $table->getRenderHTML(),
282
-            'tableItemFields' => array_keys(array_map(function (Field $f) {
282
+            'tableItemFields' => array_keys(array_map(function(Field $f) {
283 283
                 return $f->getName();
284 284
             }, $this->tableFields)),
285 285
             'titleField' => array_key_first($titleFields) ?: 'id'
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
 
315 315
         if ($mode == 'editable') {
316 316
             $vue->setEditableTemplate(
317
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
317
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
318 318
                     return $this->templateCallback($stub, $vue, $data, $m);
319 319
                 }
320 320
             );
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             );
329 329
         } else {
330 330
             $vue->setViewableTemplate(
331
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
331
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
332 332
                     return $this->templateCallback($stub, $vue, $data, $m);
333 333
                 }
334 334
             );
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
          * card
356 356
          */
357 357
         $cardFieldNames = array_map(
358
-            function (Field $field) {
358
+            function(Field $field) {
359 359
                 return $field->getName();
360 360
             },
361 361
             $this->cardFields
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
          * table
392 392
          */
393 393
         $tableFieldNames = array_map(
394
-            function (Field $field) {
394
+            function(Field $field) {
395 395
                 return $field->getName();
396 396
             },
397 397
             $this->tableFields
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
          * item
428 428
          */
429 429
         $graphqlQuery = $this->model->mapFields(
430
-            function (Field $f) {
430
+            function(Field $f) {
431 431
                 return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null;
432 432
             }
433 433
         );
@@ -496,14 +496,14 @@  discard block
 block discarded – undo
496 496
         ];
497 497
 
498 498
         $import = array_map(
499
-            function ($i) use ($name) {
499
+            function($i) use ($name) {
500 500
                 return "import {$name}$i from './{$name}$i.vue';";
501 501
             },
502 502
             $items
503 503
         );
504 504
 
505 505
         $export = array_map(
506
-            function ($i) use ($name) {
506
+            function($i) use ($name) {
507 507
                 return "    {$name}$i,\n";
508 508
             },
509 509
             $items
Please login to merge, or discard this patch.