@@ -24,7 +24,7 @@ |
||
24 | 24 | if (!count($indexFields)) { |
25 | 25 | throw new Exception("You must provide at least one field to an index"); |
26 | 26 | } |
27 | - $generator->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");'; |
|
27 | + $generator->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");'; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public static function processMigrationFieldDirective( |
@@ -14,7 +14,7 @@ |
||
14 | 14 | MigrationGenerator $generator, |
15 | 15 | \GraphQL\Language\AST\DirectiveNode $directive |
16 | 16 | ): void { |
17 | - $generator->createCode[] ='$table->softDeletes();'; |
|
17 | + $generator->createCode[] = '$table->softDeletes();'; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public static function processMigrationFieldDirective( |
@@ -26,9 +26,9 @@ |
||
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 | } |
@@ -14,7 +14,7 @@ |
||
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( |
@@ -15,7 +15,7 @@ |
||
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( |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'enum', |
161 | 161 | 'App\\Datatypes', |
162 | 162 | 'Tests\\Unit', |
163 | - function (ClassType $enumClass) use ($enumValues) { |
|
163 | + function(ClassType $enumClass) use ($enumValues) { |
|
164 | 164 | $enumClass->addConstant('CHOICES', $enumValues); |
165 | 165 | $enumClass->getMethod('__construct')->addBody('$this->choices = self::CHOICES;'); |
166 | 166 | } |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $this->getBasePath( |
465 | 465 | 'database/migrations/' . |
466 | 466 | date('Y_m_d_His') . |
467 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
467 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
468 | 468 | '_' . $this->mode . '_' . |
469 | 469 | $relation . |
470 | 470 | '_table.php' |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $this->getBasePath( |
505 | 505 | 'database/migrations/' . |
506 | 506 | date('Y_m_d_His') . |
507 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
507 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
508 | 508 | '_' . $this->mode . '_' . |
509 | 509 | $type1 . '_' . $type2 . |
510 | 510 | '_table.php' |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | return $this->getBasePath( |
550 | 550 | 'database/migrations/' . |
551 | 551 | date('Y_m_d_His') . |
552 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
552 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
553 | 553 | '_' . $this->mode . '_' . |
554 | 554 | $basename . '_table.php' |
555 | 555 | ); |
@@ -43,16 +43,16 @@ |
||
43 | 43 | */ |
44 | 44 | |
45 | 45 | switch ($arg->name->value) { |
46 | - case 'collection': |
|
47 | - /** @phpstan-ignore-next-line */ |
|
48 | - $collection = $arg->value->value; |
|
49 | - break; |
|
50 | - case 'fields': |
|
51 | - /** @phpstan-ignore-next-line */ |
|
52 | - foreach ($arg->value->values as $item) { |
|
53 | - $customFields[] = $item->value; |
|
54 | - } |
|
55 | - break; |
|
46 | + case 'collection': |
|
47 | + /** @phpstan-ignore-next-line */ |
|
48 | + $collection = $arg->value->value; |
|
49 | + break; |
|
50 | + case 'fields': |
|
51 | + /** @phpstan-ignore-next-line */ |
|
52 | + foreach ($arg->value->values as $item) { |
|
53 | + $customFields[] = $item->value; |
|
54 | + } |
|
55 | + break; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | $studlyCollection = Str::studly($collection); |
@@ -86,7 +86,7 @@ |
||
86 | 86 | ->setPublic() |
87 | 87 | ->setReturnType('string') |
88 | 88 | ->addComment("Returns the media attribute (url) for the $collection") |
89 | - ->setBody( /** @lang PHP */ |
|
89 | + ->setBody(/** @lang PHP */ |
|
90 | 90 | <<< PHP |
91 | 91 | \$image = \$generator->getMedia{$studlyCollection}Collection()->first(); |
92 | 92 | if (\$image) { |
@@ -360,7 +360,7 @@ |
||
360 | 360 | |
361 | 361 | if (!$relationshipDatatype) { |
362 | 362 | $relationshipDatatype = "relationship:" . ($isInverse ? "inverse:" : "") . |
363 | - "$relationship:$sourceTypeName:$targetTypeName"; |
|
363 | + "$relationship:$sourceTypeName:$targetTypeName"; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | $this->processField($relationshipDatatype, $field, $directives, $isRequired); |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @var ObjectType $object |
328 | 328 | */ |
329 | 329 | |
330 | - if (str_starts_with((string)$name, '__')) { |
|
330 | + if (str_starts_with((string) $name, '__')) { |
|
331 | 331 | // internal type |
332 | 332 | continue; |
333 | 333 | } |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | continue; |
340 | 340 | } |
341 | 341 | |
342 | - $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name)); |
|
342 | + $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name)); |
|
343 | 343 | $this->class->addMethod($methodName) |
344 | 344 | ->setReturnType('\\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany') |
345 | 345 | ->setPublic() |