Passed
Push — master ( 1645cc...d148de )
by Bruno
06:50
created
Modelarium/Laravel/Targets/MigrationGenerator.php 1 patch
Spacing   +6 added lines, -6 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
             }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
     public function generateManyToManyTable(string $type1, string $type2): GeneratedItem
437 437
     {
438
-        $dummyCode =  <<<EOF
438
+        $dummyCode = <<<EOF
439 439
 
440 440
         \$table->increments("id");
441 441
         \$table->unsignedBigInteger("{$type1}_id");
Please login to merge, or discard this patch.
Modelarium/Laravel/Processor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @param  string[]  $directiveNamespaces
75 75
      * @return array<string, string>
76 76
      */
77
-    public static function getDirectivesGraphql($directiveNamespaces = [ 'Modelarium\Laravel\Lighthouse\Directives' ]): array
77
+    public static function getDirectivesGraphql($directiveNamespaces = ['Modelarium\Laravel\Lighthouse\Directives']): array
78 78
     {
79 79
         $directives = [];
80 80
 
@@ -84,15 +84,15 @@  discard block
 block discarded – undo
84 84
 
85 85
             foreach ($classesInNamespace as $class) {
86 86
                 $reflection = new \ReflectionClass($class);
87
-                if (! $reflection->isInstantiable()) {
87
+                if (!$reflection->isInstantiable()) {
88 88
                     continue;
89 89
                 }
90 90
 
91
-                if (! is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) {
91
+                if (!is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) {
92 92
                     continue;
93 93
                 }
94 94
 
95
-                $name = DirectiveFactory::directiveName((string)$class);
95
+                $name = DirectiveFactory::directiveName((string) $class);
96 96
                 $directives[$name] = trim($class::definition());
97 97
             }
98 98
         }
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * @param  string[]  $directiveNamespaces
107 107
      * @return string
108 108
      */
109
-    public static function getDirectivesGraphqlString($directiveNamespaces = [ 'Modelarium\\Laravel\\Lighthouse\\Directives' ]): string
109
+    public static function getDirectivesGraphqlString($directiveNamespaces = ['Modelarium\\Laravel\\Lighthouse\\Directives']): string
110 110
     {
111 111
         return implode("\n\n", self::getDirectivesGraphql($directiveNamespaces));
112 112
     }
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                 if ($name === 'Query' || $name === 'Mutation' || $name === 'Subscription' || $name === 'Can') {
164 164
                     continue;
165 165
                 }
166
-                $g = $this->processType((string)$name, $object);
166
+                $g = $this->processType((string) $name, $object);
167 167
                 $this->collection = $this->collection->merge($g);
168 168
             }
169 169
         }
Please login to merge, or discard this patch.
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/ModelGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
                 break;
282 282
 
283 283
             case 'morphedByMany':
284
-                $relationship = 'NN';// TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO
284
+                $relationship = 'NN'; // TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO
285 285
                 $typeMap = $this->parser->getSchema()->getTypeMap();
286 286
        
287 287
                 foreach ($typeMap as $name => $object) {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
                      * @var ObjectType $object
294 294
                      */
295 295
 
296
-                    if (str_starts_with((string)$name, '__')) {
296
+                    if (str_starts_with((string) $name, '__')) {
297 297
                         // internal type
298 298
                         continue;
299 299
                     }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
                             continue;
306 306
                         }
307 307
 
308
-                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name));
308
+                        $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name));
309 309
                         $this->class->addMethod($methodName)
310 310
                                 ->setPublic()
311 311
                                 ->setBody("return \$this->morphedByMany($name::class, '$lowerName');");
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
         if ($generateRandom) {
329 329
             $this->methodRandom->addBody(
330 330
                 '$data["' . $lowerName . '_id"] = function () {' . "\n" .
331
-                '    return factory(' . $targetClass . '::class)->create()->id;'  . "\n" .
331
+                '    return factory(' . $targetClass . '::class)->create()->id;' . "\n" .
332 332
                 '};'
333 333
             );
334 334
         }
Please login to merge, or discard this patch.