@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function generate(): GeneratedCollection |
11 | 11 | { |
12 | 12 | return new GeneratedCollection( |
13 | - [ new GeneratedItem( |
|
13 | + [new GeneratedItem( |
|
14 | 14 | GeneratedItem::TYPE_SEED, |
15 | 15 | $this->generateString(), |
16 | 16 | $this->getGenerateFilename() |
@@ -25,6 +25,6 @@ discard block |
||
25 | 25 | |
26 | 26 | public function getGenerateFilename(): string |
27 | 27 | { |
28 | - return $this->getBasePath('database/seeds/'. $this->studlyName . 'Seeder.php'); |
|
28 | + return $this->getBasePath('database/seeds/' . $this->studlyName . 'Seeder.php'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -9,7 +9,7 @@ |
||
9 | 9 | public function filterByType(string $type): GeneratedCollection |
10 | 10 | { |
11 | 11 | return $this->filter( |
12 | - function ($i) use ($type) { |
|
12 | + function($i) use ($type) { |
|
13 | 13 | return $i->type == $type; |
14 | 14 | } |
15 | 15 | ); |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function generate(): GeneratedCollection |
11 | 11 | { |
12 | 12 | return new GeneratedCollection( |
13 | - [ new GeneratedItem( |
|
13 | + [new GeneratedItem( |
|
14 | 14 | GeneratedItem::TYPE_FACTORY, |
15 | 15 | $this->generateString(), |
16 | 16 | $this->getGenerateFilename() |
@@ -25,6 +25,6 @@ discard block |
||
25 | 25 | |
26 | 26 | public function getGenerateFilename(): string |
27 | 27 | { |
28 | - return $this->getBasePath('database/factories/'. $this->studlyName . 'Factory.php'); |
|
28 | + return $this->getBasePath('database/factories/' . $this->studlyName . 'Factory.php'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | throw new Exception("Directive $validator does not have argument $argName"); |
107 | 107 | } |
108 | 108 | if ($argValidator->type === 'Int') { |
109 | - $argValue = (int)$argValue; |
|
109 | + $argValue = (int) $argValue; |
|
110 | 110 | } |
111 | 111 | $arguments[$argName] = $argValue; |
112 | 112 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $name = $directive->name->value; |
293 | 293 | switch ($name) { |
294 | 294 | case 'migrationSoftDeletes': |
295 | - $this->createCode[] ='$table->softDeletes();'; |
|
295 | + $this->createCode[] = '$table->softDeletes();'; |
|
296 | 296 | break; |
297 | 297 | case 'migrationPrimaryIndex': |
298 | 298 | // TODO |
@@ -307,10 +307,10 @@ discard block |
||
307 | 307 | if (!count($indexFields)) { |
308 | 308 | throw new Exception("You must provide at least one field to an index"); |
309 | 309 | } |
310 | - $this->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");'; |
|
310 | + $this->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");'; |
|
311 | 311 | break; |
312 | 312 | case 'migrationSpatialIndex': |
313 | - $this->createCode[] ='$table->spatialIndex("' . $directive->arguments[0]->value->value .'");'; |
|
313 | + $this->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");'; |
|
314 | 314 | break; |
315 | 315 | |
316 | 316 | case 'migrationFulltextIndex': |
@@ -331,10 +331,10 @@ discard block |
||
331 | 331 | "\")');"; |
332 | 332 | break; |
333 | 333 | case 'migrationRememberToken': |
334 | - $this->createCode[] ='$table->rememberToken();'; |
|
334 | + $this->createCode[] = '$table->rememberToken();'; |
|
335 | 335 | break; |
336 | 336 | case 'migrationTimestamps': |
337 | - $this->createCode[] ='$table->timestamps();'; |
|
337 | + $this->createCode[] = '$table->timestamps();'; |
|
338 | 338 | break; |
339 | 339 | default: |
340 | 340 | } |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | |
344 | 344 | public function generateString(): string |
345 | 345 | { |
346 | - return $this->stubToString('migration', function ($stub) { |
|
346 | + return $this->stubToString('migration', function($stub) { |
|
347 | 347 | foreach ($this->type->getFields() as $field) { |
348 | 348 | $directives = $field->astNode->directives; |
349 | 349 | if ( |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | |
416 | 416 | public function generateManyToManyTable(string $type1, string $type2): GeneratedItem |
417 | 417 | { |
418 | - $contents = $this->stubToString('migration', function ($stub) use ($type1, $type2) { |
|
418 | + $contents = $this->stubToString('migration', function($stub) use ($type1, $type2) { |
|
419 | 419 | $code = <<<EOF |
420 | 420 | |
421 | 421 | \$table->increments("id"); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | Event::listen( |
30 | 30 | RegisterDirectiveNamespaces::class, |
31 | - function (RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
31 | + function(RegisterDirectiveNamespaces $registerDirectiveNamespaces): string { |
|
32 | 32 | return 'Modelarium\\Laravel\\Lighthouse\\Directives'; |
33 | 33 | } |
34 | 34 | ); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | { |
160 | 160 | $originalTypeLoader = $this->schema->getConfig()->typeLoader; |
161 | 161 | |
162 | - $this->schema->getConfig()->typeLoader = function ($typeName) use ($originalTypeLoader) { |
|
162 | + $this->schema->getConfig()->typeLoader = function($typeName) use ($originalTypeLoader) { |
|
163 | 163 | $type = $originalTypeLoader($typeName); |
164 | 164 | if ($type instanceof \GraphQL\Type\Definition\CustomScalarType) { |
165 | 165 | $scalarName = $type->name; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | { |
175 | 175 | $this->ast = Visitor::visit($this->ast, [ |
176 | 176 | // load the scalar type classes |
177 | - NodeKind::SCALAR_TYPE_DEFINITION => function ($node) { |
|
177 | + NodeKind::SCALAR_TYPE_DEFINITION => function($node) { |
|
178 | 178 | $scalarName = $node->name->value; |
179 | 179 | |
180 | 180 | // load classes |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | return []; |
238 | 238 | } |
239 | 239 | return array_map( |
240 | - function ($i) use ($basedir) { |
|
240 | + function($i) use ($basedir) { |
|
241 | 241 | $name = $i[1]; |
242 | 242 | if (array_key_exists($name, $this->imports)) { |
243 | 243 | return $this->imports[$name]; |
@@ -233,7 +233,7 @@ |
||
233 | 233 | if ($generateRandom) { |
234 | 234 | $this->methodRandom->addBody( |
235 | 235 | '$data["' . $lowerName . '_id"] = function () {' . "\n" . |
236 | - ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
236 | + ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
237 | 237 | '};' |
238 | 238 | ); |
239 | 239 | } |
@@ -115,7 +115,7 @@ |
||
115 | 115 | $this->writeFiles( |
116 | 116 | $processor->getCollection(), |
117 | 117 | base_path(), |
118 | - (bool)$this->option('overwrite') |
|
118 | + (bool) $this->option('overwrite') |
|
119 | 119 | ); |
120 | 120 | $this->info('Finished. You might want to run `composer dump-autoload`'); |
121 | 121 | } |