Passed
Push — master ( 423ab1...c488c7 )
by Bruno
06:36
created
Modelarium/Datatypes/Datatype_relationship.php 2 patches
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,19 +29,19 @@
 block discarded – undo
29 29
         if (preg_match('/^relationship:(11|1N|N1|NN):([a-zA-Z0-9]+):([a-zA-Z0-9]+)$/', $name, $matches)) {
30 30
             $mode = null;
31 31
             switch ($matches[1]) {
32
-                case '11':
33
-                    $mode = self::RELATIONSHIP_ONE_TO_ONE;
34
-                    break;
35
-                case '1N':
36
-                    $mode = self::RELATIONSHIP_ONE_TO_MANY;
37
-                    break;
38
-                case 'NN':
39
-                case 'N1': // TODO
40
-                        $mode = self::RELATIONSHIP_MANY_TO_MANY;
41
-                    break;
42
-                // TODO: morph
43
-                default:
44
-                    throw new ClassNotFoundException('Invalid relationship');
32
+            case '11':
33
+                $mode = self::RELATIONSHIP_ONE_TO_ONE;
34
+                break;
35
+            case '1N':
36
+                $mode = self::RELATIONSHIP_ONE_TO_MANY;
37
+                break;
38
+            case 'NN':
39
+            case 'N1': // TODO
40
+                    $mode = self::RELATIONSHIP_MANY_TO_MANY;
41
+                break;
42
+            // TODO: morph
43
+            default:
44
+                throw new ClassNotFoundException('Invalid relationship');
45 45
             }
46 46
             return static::factory($matches[2], $matches[3], $matches[1]); // $mode);
47 47
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,10 +14,10 @@  discard block
 block discarded – undo
14 14
     public const RELATIONSHIP = "RELATIONSHIP";
15 15
     public const RELATIONSHIP_ONE_TO_ONE = "RELATIONSHIP_ONE_TO_ONE";
16 16
     public const RELATIONSHIP_ONE_TO_MANY = "RELATIONSHIP_ONE_TO_MANY";
17
-    public const RELATIONSHIP_MANY_TO_MANY  = "RELATIONSHIP_MANY_TO_MANY";
17
+    public const RELATIONSHIP_MANY_TO_MANY = "RELATIONSHIP_MANY_TO_MANY";
18 18
     public const MORPH_ONE_TO_ONE = "RELATIONSHIP_ONE_TO_ONE";
19 19
     public const MORPH_ONE_TO_MANY = "RELATIONSHIP_ONE_TO_MANY";
20
-    public const MORPH_MANY_TO_MANY  = "RELATIONSHIP_MANY_TO_MANY";
20
+    public const MORPH_MANY_TO_MANY = "RELATIONSHIP_MANY_TO_MANY";
21 21
 
22 22
     /**
23 23
      * @param string $name relationship:[mode]:[source]:[target]
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * @var string
76 76
      */
77
-    protected $targetClass= '';
77
+    protected $targetClass = '';
78 78
 
79 79
     /**
80 80
      * @var string
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/MigrationGenerator.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
             $name = $directive->name->value;
307 307
             switch ($name) {
308 308
             case 'migrationSoftDeletes':
309
-                $this->createCode[] ='$table->softDeletes();';
309
+                $this->createCode[] = '$table->softDeletes();';
310 310
                 break;
311 311
             case 'migrationPrimaryIndex':
312 312
                 // TODO
@@ -321,10 +321,10 @@  discard block
 block discarded – undo
321 321
                 if (!count($indexFields)) {
322 322
                     throw new Exception("You must provide at least one field to an index");
323 323
                 }
324
-                $this->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");';
324
+                $this->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");';
325 325
                 break;
326 326
             case 'migrationSpatialIndex':
327
-                $this->createCode[] ='$table->spatialIndex("' . $directive->arguments[0]->value->value .'");';
327
+                $this->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");';
328 328
                 break;
329 329
 
330 330
             case 'migrationFulltextIndex':
@@ -345,10 +345,10 @@  discard block
 block discarded – undo
345 345
                     "\")');";
346 346
                 break;
347 347
             case 'migrationRememberToken':
348
-                $this->createCode[] ='$table->rememberToken();';
348
+                $this->createCode[] = '$table->rememberToken();';
349 349
                 break;
350 350
             case 'migrationTimestamps':
351
-                $this->createCode[] ='$table->timestamps();';
351
+                $this->createCode[] = '$table->timestamps();';
352 352
                 break;
353 353
             default:
354 354
             }
Please login to merge, or discard this patch.
Modelarium/Laravel/Targets/ModelGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
                 break;
284 284
 
285 285
             case 'morphedByMany':
286
-                $relationship = 'NN';// TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO
286
+                $relationship = 'NN'; // TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO
287 287
                 $typeMap = $this->parser->getSchema()->getTypeMap();
288 288
        
289 289
                 foreach ($typeMap as $name => $object) {
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                      * @var ObjectType $object
296 296
                      */
297 297
 
298
-                    if (str_starts_with((string)$name, '__')) {
298
+                    if (str_starts_with((string) $name, '__')) {
299 299
                         // internal type
300 300
                         continue;
301 301
                     }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
                             continue;
308 308
                         }
309 309
 
310
-                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name));
310
+                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name));
311 311
                         $this->class->addMethod($methodName)
312 312
                                 ->setReturnType('\\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany')
313 313
                                 ->setPublic()
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
         if ($generateRandom) {
332 332
             $this->methodRandom->addBody(
333 333
                 '$data["' . $lowerName . '_id"] = function () {' . "\n" .
334
-                '    return factory(' . $targetClass . '::class)->create()->id;'  . "\n" .
334
+                '    return factory(' . $targetClass . '::class)->create()->id;' . "\n" .
335 335
                 '};'
336 336
             );
337 337
         }
Please login to merge, or discard this patch.
Modelarium/Frontend/FrontendGenerator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     protected function buildTemplateParameters(): void
100 100
     {
101 101
         $this->cardFields = $this->model->filterField(
102
-            function (Field $field) {
102
+            function(Field $field) {
103 103
                 return $field->getRenderable('card', false);
104 104
             }
105 105
         );
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             'Table',
109 109
             [
110 110
                 Table::ROW_NAMES => array_map(
111
-                    function (Field $field) {
111
+                    function(Field $field) {
112 112
                         return $field->getRenderable(Renderable::LABEL, $field->getName());
113 113
                     },
114 114
                     $this->cardFields
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
         if ($mode == 'editable') {
160 160
             $vue->setEditableTemplate(
161
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
161
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
162 162
                     return $this->templateCallback($stub, $vue, $data, $m);
163 163
                 }
164 164
             );
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             );
173 173
         } else {
174 174
             $vue->setViewableTemplate(
175
-                function (FrameworkVue $vue, array $data, Model $m) use ($stub) {
175
+                function(FrameworkVue $vue, array $data, Model $m) use ($stub) {
176 176
                     return $this->templateCallback($stub, $vue, $data, $m);
177 177
                 }
178 178
             );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     protected function makeGraphql(): void
197 197
     {
198 198
         $cardFieldNames = array_map(
199
-            function (Field $field) {
199
+            function(Field $field) {
200 200
                 return $field->getName();
201 201
             },
202 202
             $this->cardFields
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
         ];
278 278
 
279 279
         $import = array_map(
280
-            function ($i) use ($name) {
280
+            function($i) use ($name) {
281 281
                 return "import {$name}$i from './{$name}$i.vue';";
282 282
             },
283 283
             $items
284 284
         );
285 285
 
286 286
         $export = array_map(
287
-            function ($i) use ($name) {
287
+            function($i) use ($name) {
288 288
                 return "    {$name}$i,\n";
289 289
             },
290 290
             $items
Please login to merge, or discard this patch.