@@ -16,7 +16,7 @@ |
||
16 | 16 | public static function processModelFieldDirective( |
17 | 17 | ModelGenerator $generator, |
18 | 18 | \GraphQL\Type\Definition\FieldDefinition $field, |
19 | - \Formularium\Field $fieldFormularium, |
|
19 | + \Formularium\Field $fieldFormularium, |
|
20 | 20 | \GraphQL\Language\AST\DirectiveNode $directive |
21 | 21 | ): void { |
22 | 22 | $fieldName = $field->name; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public static function processModelFieldDirective( |
18 | 18 | ModelGenerator $generator, |
19 | 19 | \GraphQL\Type\Definition\FieldDefinition $field, |
20 | - \Formularium\Field $fieldFormularium, |
|
20 | + \Formularium\Field $fieldFormularium, |
|
21 | 21 | \GraphQL\Language\AST\DirectiveNode $directive |
22 | 22 | ): void { |
23 | 23 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | public static function processModelFieldDirective( |
17 | 17 | ModelGenerator $generator, |
18 | 18 | \GraphQL\Type\Definition\FieldDefinition $field, |
19 | - \Formularium\Field $fieldFormularium, |
|
19 | + \Formularium\Field $fieldFormularium, |
|
20 | 20 | \GraphQL\Language\AST\DirectiveNode $directive |
21 | 21 | ): void { |
22 | 22 | $fieldName = $field->name; |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | 'enum', |
206 | 206 | 'App\\Datatypes', |
207 | 207 | 'Tests\\Unit', |
208 | - function (ClassType $enumClass) use ($enumValues) { |
|
208 | + function(ClassType $enumClass) use ($enumValues) { |
|
209 | 209 | $enumClass->addConstant('CHOICES', $enumValues); |
210 | 210 | $enumClass->getMethod('__construct')->addBody('$this->choices = self::CHOICES;'); |
211 | 211 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | } |
254 | 254 | |
255 | 255 | $options = []; // TODO: from directives |
256 | - $codeFragment->appendBase('$table->' . $ourType->getLaravelSQLType($fieldName, $options)); |
|
256 | + $codeFragment->appendBase('$table->' . $ourType->getLaravelSQLType($fieldName, $options)); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | protected function processRelationship( |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $this->getBasePath( |
489 | 489 | 'database/migrations/' . |
490 | 490 | date('Y_m_d_His') . |
491 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
491 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
492 | 492 | '_' . $this->mode . '_' . |
493 | 493 | $relation . |
494 | 494 | '_table.php' |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | $this->getBasePath( |
529 | 529 | 'database/migrations/' . |
530 | 530 | date('Y_m_d_His') . |
531 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
531 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
532 | 532 | '_' . $this->mode . '_' . |
533 | 533 | $type1 . '_' . $type2 . |
534 | 534 | '_table.php' |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | return $this->getBasePath( |
574 | 574 | 'database/migrations/' . |
575 | 575 | date('Y_m_d_His') . |
576 | - str_pad((string)(static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
576 | + str_pad((string) (static::$counter++), 3, "0", STR_PAD_LEFT) . // so we keep the same order of types in schema |
|
577 | 577 | '_' . $this->mode . '_' . |
578 | 578 | $basename . '_table.php' |
579 | 579 | ); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @param string[] $directiveNamespaces |
78 | 78 | * @return array<string, string> |
79 | 79 | */ |
80 | - public static function getDirectivesGraphql($directiveNamespaces = [ 'Modelarium\Laravel\Lighthouse\Directives' ]): array |
|
80 | + public static function getDirectivesGraphql($directiveNamespaces = ['Modelarium\Laravel\Lighthouse\Directives']): array |
|
81 | 81 | { |
82 | 82 | $directives = []; |
83 | 83 | |
@@ -87,15 +87,15 @@ discard block |
||
87 | 87 | |
88 | 88 | foreach ($classesInNamespace as $class) { |
89 | 89 | $reflection = new \ReflectionClass($class); |
90 | - if (! $reflection->isInstantiable()) { |
|
90 | + if (!$reflection->isInstantiable()) { |
|
91 | 91 | continue; |
92 | 92 | } |
93 | 93 | |
94 | - if (! is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) { |
|
94 | + if (!is_a($class, \Nuwave\Lighthouse\Schema\Directives\BaseDirective::class, true)) { |
|
95 | 95 | continue; |
96 | 96 | } |
97 | 97 | |
98 | - $name = DirectiveFactory::directiveName((string)$class); |
|
98 | + $name = DirectiveFactory::directiveName((string) $class); |
|
99 | 99 | // @phpstan-ignore-next-line |
100 | 100 | $directives[$name] = trim($class::definition()); |
101 | 101 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param string[] $directiveNamespaces |
111 | 111 | * @return string |
112 | 112 | */ |
113 | - public static function getDirectivesGraphqlString($directiveNamespaces = [ 'Modelarium\\Laravel\\Lighthouse\\Directives' ]): string |
|
113 | + public static function getDirectivesGraphqlString($directiveNamespaces = ['Modelarium\\Laravel\\Lighthouse\\Directives']): string |
|
114 | 114 | { |
115 | 115 | return implode("\n\n", self::getDirectivesGraphql($directiveNamespaces)); |
116 | 116 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | if ($name === 'Query' || $name === 'Mutation' || $name === 'Subscription' || $name === 'Can') { |
168 | 168 | continue; |
169 | 169 | } |
170 | - $g = $this->processType((string)$name, $object); |
|
170 | + $g = $this->processType((string) $name, $object); |
|
171 | 171 | $this->collection = $this->collection->merge($g); |
172 | 172 | } |
173 | 173 | } |
@@ -67,10 +67,10 @@ |
||
67 | 67 | $targetDirectives = $targetField->astNode->directives; |
68 | 68 | foreach ($targetDirectives as $targetDirective) { |
69 | 69 | switch ($targetDirective->name->value) { |
70 | - case 'hasOne': |
|
71 | - case 'hasMany': |
|
72 | - $codeFragment->appendBase('->unsignedBigInteger("' . $fieldName . '")'); |
|
73 | - break; |
|
70 | + case 'hasOne': |
|
71 | + case 'hasMany': |
|
72 | + $codeFragment->appendBase('->unsignedBigInteger("' . $fieldName . '")'); |
|
73 | + break; |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | |
33 | 33 | return new GeneratedCollection( |
34 | - [ new GeneratedItem( |
|
34 | + [new GeneratedItem( |
|
35 | 35 | GeneratedItem::TYPE_FACTORY, |
36 | 36 | $this->generateString(), |
37 | 37 | $this->getGenerateFilename() |
@@ -50,6 +50,6 @@ discard block |
||
50 | 50 | |
51 | 51 | public function getGenerateFilename(): string |
52 | 52 | { |
53 | - return $this->getBasePath('database/factories/'. $this->studlyName . 'Factory.php'); |
|
53 | + return $this->getBasePath('database/factories/' . $this->studlyName . 'Factory.php'); |
|
54 | 54 | } |
55 | 55 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | 'implements' => implode( |
23 | 23 | ', ', |
24 | 24 | array_map( |
25 | - function ($i) { |
|
25 | + function($i) { |
|
26 | 26 | return Str::studly($i) . 'DirectiveInterface'; |
27 | 27 | }, |
28 | 28 | $processors |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | // Script example.php |
63 | -$longopts = array( |
|
63 | +$longopts = array( |
|
64 | 64 | "name:", |
65 | 65 | "processors:" |
66 | 66 | ); |
@@ -60,18 +60,18 @@ |
||
60 | 60 | $targetSingle = mb_strtolower($generator->getInflector()->singularize($datatype->getTarget())); |
61 | 61 | $targetPlural = $datatype->getTargetTable(); |
62 | 62 | switch ($datatype->getRelationship()) { |
63 | - case RelationshipFactory::RELATIONSHIP_ONE_TO_ONE: |
|
64 | - case RelationshipFactory::MORPH_ONE_TO_ONE: |
|
65 | - $target = $targetSingle; |
|
66 | - break; |
|
67 | - case RelationshipFactory::RELATIONSHIP_ONE_TO_MANY: |
|
68 | - case RelationshipFactory::MORPH_ONE_TO_MANY: |
|
69 | - $target = $datatype->getIsInverse() ? $targetSingle : $targetPlural; |
|
70 | - break; |
|
71 | - case RelationshipFactory::RELATIONSHIP_MANY_TO_MANY: |
|
72 | - case RelationshipFactory::MORPH_MANY_TO_MANY: |
|
73 | - $target = $targetPlural; |
|
74 | - break; |
|
63 | + case RelationshipFactory::RELATIONSHIP_ONE_TO_ONE: |
|
64 | + case RelationshipFactory::MORPH_ONE_TO_ONE: |
|
65 | + $target = $targetSingle; |
|
66 | + break; |
|
67 | + case RelationshipFactory::RELATIONSHIP_ONE_TO_MANY: |
|
68 | + case RelationshipFactory::MORPH_ONE_TO_MANY: |
|
69 | + $target = $datatype->getIsInverse() ? $targetSingle : $targetPlural; |
|
70 | + break; |
|
71 | + case RelationshipFactory::RELATIONSHIP_MANY_TO_MANY: |
|
72 | + case RelationshipFactory::MORPH_MANY_TO_MANY: |
|
73 | + $target = $targetPlural; |
|
74 | + break; |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | $generator->with[] = $target; |