@@ -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 | ); |
@@ -127,7 +127,7 @@ |
||
| 127 | 127 | ->setPublic() |
| 128 | 128 | ->setReturnType('string') |
| 129 | 129 | ->addComment("Returns the media attribute (url) for the $collection") |
| 130 | - ->setBody( /** @lang PHP */ |
|
| 130 | + ->setBody(/** @lang PHP */ |
|
| 131 | 131 | <<< PHP |
| 132 | 132 | \$image = \$this->getMedia{$studlyCollection}Collection()->first(); |
| 133 | 133 | if (\$image) { |
@@ -48,32 +48,32 @@ |
||
| 48 | 48 | */ |
| 49 | 49 | |
| 50 | 50 | switch ($arg->name->value) { |
| 51 | - case 'collection': |
|
| 52 | - /** @phpstan-ignore-next-line */ |
|
| 53 | - $collection = $arg->value->value; |
|
| 54 | - break; |
|
| 55 | - case 'fields': |
|
| 56 | - /** @phpstan-ignore-next-line */ |
|
| 57 | - foreach ($arg->value->values as $item) { |
|
| 58 | - $customFields[] = $item->value; |
|
| 59 | - } |
|
| 60 | - break; |
|
| 61 | - case 'conversion': |
|
| 62 | - /** @phpstan-ignore-next-line */ |
|
| 63 | - $conversion = $arg->value->value; |
|
| 64 | - break; |
|
| 65 | - case 'width': |
|
| 66 | - /** @phpstan-ignore-next-line */ |
|
| 67 | - $width = $arg->value->value; |
|
| 68 | - break; |
|
| 69 | - case 'height': |
|
| 70 | - /** @phpstan-ignore-next-line */ |
|
| 71 | - $height = $arg->value->value; |
|
| 72 | - break; |
|
| 73 | - case 'responsive': |
|
| 74 | - /** @phpstan-ignore-next-line */ |
|
| 75 | - $responsive = $arg->value->value; |
|
| 76 | - break; |
|
| 51 | + case 'collection': |
|
| 52 | + /** @phpstan-ignore-next-line */ |
|
| 53 | + $collection = $arg->value->value; |
|
| 54 | + break; |
|
| 55 | + case 'fields': |
|
| 56 | + /** @phpstan-ignore-next-line */ |
|
| 57 | + foreach ($arg->value->values as $item) { |
|
| 58 | + $customFields[] = $item->value; |
|
| 59 | + } |
|
| 60 | + break; |
|
| 61 | + case 'conversion': |
|
| 62 | + /** @phpstan-ignore-next-line */ |
|
| 63 | + $conversion = $arg->value->value; |
|
| 64 | + break; |
|
| 65 | + case 'width': |
|
| 66 | + /** @phpstan-ignore-next-line */ |
|
| 67 | + $width = $arg->value->value; |
|
| 68 | + break; |
|
| 69 | + case 'height': |
|
| 70 | + /** @phpstan-ignore-next-line */ |
|
| 71 | + $height = $arg->value->value; |
|
| 72 | + break; |
|
| 73 | + case 'responsive': |
|
| 74 | + /** @phpstan-ignore-next-line */ |
|
| 75 | + $responsive = $arg->value->value; |
|
| 76 | + break; |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | $studlyCollection = Str::studly($collection); |
@@ -61,7 +61,7 @@ discard block |
||
| 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 |
||
| 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() |