@@ -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 | } |
@@ -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]; |
@@ -105,24 +105,24 @@ |
||
| 105 | 105 | |
| 106 | 106 | foreach ($directive->arguments as $arg) { |
| 107 | 107 | switch ($arg->name->value) { |
| 108 | - case 'ability': |
|
| 109 | - // @phpstan-ignore-next-line |
|
| 110 | - $ability = $arg->value->value; |
|
| 111 | - break; |
|
| 112 | - case 'find': |
|
| 113 | - // @phpstan-ignore-next-line |
|
| 114 | - $find = $arg->value->value; |
|
| 115 | - break; |
|
| 116 | - case 'model': |
|
| 117 | - // @phpstan-ignore-next-line |
|
| 118 | - $model = $arg->value->value; |
|
| 119 | - break; |
|
| 120 | - case 'injectArgs': |
|
| 121 | - $injected = true; |
|
| 122 | - break; |
|
| 123 | - case 'args': |
|
| 124 | - $args = true; |
|
| 125 | - break; |
|
| 108 | + case 'ability': |
|
| 109 | + // @phpstan-ignore-next-line |
|
| 110 | + $ability = $arg->value->value; |
|
| 111 | + break; |
|
| 112 | + case 'find': |
|
| 113 | + // @phpstan-ignore-next-line |
|
| 114 | + $find = $arg->value->value; |
|
| 115 | + break; |
|
| 116 | + case 'model': |
|
| 117 | + // @phpstan-ignore-next-line |
|
| 118 | + $model = $arg->value->value; |
|
| 119 | + break; |
|
| 120 | + case 'injectArgs': |
|
| 121 | + $injected = true; |
|
| 122 | + break; |
|
| 123 | + case 'args': |
|
| 124 | + $args = true; |
|
| 125 | + break; |
|
| 126 | 126 | } |
| 127 | 127 | } |
| 128 | 128 | |
@@ -168,6 +168,6 @@ |
||
| 168 | 168 | |
| 169 | 169 | public function getGenerateFilename(string $name): string |
| 170 | 170 | { |
| 171 | - return $this->getBasePath('app/Policies/'. Str::studly($name) . 'Policy.php'); |
|
| 171 | + return $this->getBasePath('app/Policies/' . Str::studly($name) . 'Policy.php'); |
|
| 172 | 172 | } |
| 173 | 173 | } |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | $this->writeFiles( |
| 113 | 113 | $processor->getCollection(), |
| 114 | 114 | base_path(), |
| 115 | - (bool)$this->option('overwrite') |
|
| 115 | + (bool) $this->option('overwrite') |
|
| 116 | 116 | ); |
| 117 | 117 | $this->info('Finished scaffolding. You might want to run `composer dump-autoload`'); |
| 118 | 118 | } |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | $writtenFiles = $this->writeFiles( |
| 82 | 82 | $collection, |
| 83 | 83 | $basepath, |
| 84 | - (bool)$this->option('overwrite') |
|
| 84 | + (bool) $this->option('overwrite') |
|
| 85 | 85 | ); |
| 86 | 86 | $this->info('Files generated.'); |
| 87 | 87 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $name = $directive->name->value; |
| 302 | 302 | switch ($name) { |
| 303 | 303 | case 'migrationSoftDeletes': |
| 304 | - $this->createCode[] ='$table->softDeletes();'; |
|
| 304 | + $this->createCode[] = '$table->softDeletes();'; |
|
| 305 | 305 | break; |
| 306 | 306 | case 'migrationPrimaryIndex': |
| 307 | 307 | // TODO |
@@ -316,10 +316,10 @@ discard block |
||
| 316 | 316 | if (!count($indexFields)) { |
| 317 | 317 | throw new Exception("You must provide at least one field to an index"); |
| 318 | 318 | } |
| 319 | - $this->createCode[] ='$table->index("' . implode('", "', $indexFields) .'");'; |
|
| 319 | + $this->createCode[] = '$table->index("' . implode('", "', $indexFields) . '");'; |
|
| 320 | 320 | break; |
| 321 | 321 | case 'migrationSpatialIndex': |
| 322 | - $this->createCode[] ='$table->spatialIndex("' . $directive->arguments[0]->value->value .'");'; |
|
| 322 | + $this->createCode[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");'; |
|
| 323 | 323 | break; |
| 324 | 324 | |
| 325 | 325 | case 'migrationFulltextIndex': |
@@ -340,10 +340,10 @@ discard block |
||
| 340 | 340 | "\")');"; |
| 341 | 341 | break; |
| 342 | 342 | case 'migrationRememberToken': |
| 343 | - $this->createCode[] ='$table->rememberToken();'; |
|
| 343 | + $this->createCode[] = '$table->rememberToken();'; |
|
| 344 | 344 | break; |
| 345 | 345 | case 'migrationTimestamps': |
| 346 | - $this->createCode[] ='$table->timestamps();'; |
|
| 346 | + $this->createCode[] = '$table->timestamps();'; |
|
| 347 | 347 | break; |
| 348 | 348 | default: |
| 349 | 349 | } |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | public function generateString(): string |
| 354 | 354 | { |
| 355 | - return $this->stubToString('migration', function ($stub) { |
|
| 355 | + return $this->stubToString('migration', function($stub) { |
|
| 356 | 356 | foreach ($this->type->getFields() as $field) { |
| 357 | 357 | $directives = $field->astNode->directives; |
| 358 | 358 | if ( |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | |
| 427 | 427 | public function generateManyToManyMorphTable(string $name, string $relation): GeneratedItem |
| 428 | 428 | { |
| 429 | - $contents = $this->stubToString('migration', function ($stub) use ($name, $relation) { |
|
| 429 | + $contents = $this->stubToString('migration', function($stub) use ($name, $relation) { |
|
| 430 | 430 | $code = <<<EOF |
| 431 | 431 | |
| 432 | 432 | \$table->unsignedBigInteger("{$name}_id"); |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | |
| 473 | 473 | public function generateManyToManyTable(string $type1, string $type2): GeneratedItem |
| 474 | 474 | { |
| 475 | - $contents = $this->stubToString('migration', function ($stub) use ($type1, $type2) { |
|
| 475 | + $contents = $this->stubToString('migration', function($stub) use ($type1, $type2) { |
|
| 476 | 476 | $code = <<<EOF |
| 477 | 477 | |
| 478 | 478 | \$table->increments("id"); |