@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | * @var ObjectType $object |
272 | 272 | */ |
273 | 273 | |
274 | - if (str_starts_with((string)$name, '__')) { |
|
274 | + if (str_starts_with((string) $name, '__')) { |
|
275 | 275 | // internal type |
276 | 276 | continue; |
277 | 277 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | continue; |
284 | 284 | } |
285 | 285 | |
286 | - $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name)); |
|
286 | + $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name)); |
|
287 | 287 | $this->class->addMethod($methodName) |
288 | 288 | ->setPublic() |
289 | 289 | ->setBody("return \$this->morphedByMany($name::class, '$lowerName');"); |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | if ($generateRandom) { |
302 | 302 | $this->methodRandom->addBody( |
303 | 303 | '$data["' . $lowerName . '_id"] = function () {' . "\n" . |
304 | - ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
304 | + ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
305 | 305 | '};' |
306 | 306 | ); |
307 | 307 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | protected function buildTemplateParameters(): void |
91 | 91 | { |
92 | 92 | $this->cardFields = $this->model->filterField( |
93 | - function (Field $field) { |
|
93 | + function(Field $field) { |
|
94 | 94 | return $field->getRenderable('card', false); |
95 | 95 | } |
96 | 96 | ); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | |
122 | 122 | if ($mode == 'editable') { |
123 | 123 | $vue->setEditableTemplate( |
124 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
124 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
125 | 125 | return $this->templateCallback($stub, $vue, $data, $m); |
126 | 126 | } |
127 | 127 | ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ); |
136 | 136 | } else { |
137 | 137 | $vue->setViewableTemplate( |
138 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
138 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
139 | 139 | return $this->templateCallback($stub, $vue, $data, $m); |
140 | 140 | } |
141 | 141 | ); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | protected function makeGraphql(): void |
154 | 154 | { |
155 | 155 | $cardFieldNames = array_map( |
156 | - function (Field $field) { |
|
156 | + function(Field $field) { |
|
157 | 157 | return $field->getName(); |
158 | 158 | }, |
159 | 159 | $this->cardFields |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | ]; |
234 | 234 | |
235 | 235 | $import = array_map( |
236 | - function ($i) use ($name) { |
|
236 | + function($i) use ($name) { |
|
237 | 237 | return "import {$name}$i from './{$name}$i.vue';"; |
238 | 238 | }, |
239 | 239 | $items |
240 | 240 | ); |
241 | 241 | |
242 | 242 | $export = array_map( |
243 | - function ($i) use ($name) { |
|
243 | + function($i) use ($name) { |
|
244 | 244 | return " {$name}$i,\n"; |
245 | 245 | }, |
246 | 246 | $items |
@@ -306,7 +306,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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"); |
@@ -74,7 +74,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |