@@ -65,24 +65,24 @@ |
||
| 65 | 65 | $model = $field->type->name; /** @phpstan-ignore-line */; |
| 66 | 66 | foreach ($directive->arguments as $arg) { |
| 67 | 67 | switch ($arg->name->value) { |
| 68 | - case 'ability': |
|
| 69 | - // @phpstan-ignore-next-line |
|
| 70 | - $ability = $arg->value->value; |
|
| 71 | - break; |
|
| 72 | - case 'find': |
|
| 73 | - // @phpstan-ignore-next-line |
|
| 74 | - $find = $arg->value->value; |
|
| 75 | - break; |
|
| 76 | - case 'model': |
|
| 77 | - // @phpstan-ignore-next-line |
|
| 78 | - $model = $arg->value->value; |
|
| 79 | - break; |
|
| 80 | - case 'injectArgs': |
|
| 81 | - $injected = ', array $injectedArgs'; |
|
| 82 | - break; |
|
| 83 | - case 'args': |
|
| 84 | - $args = ', array $staticArgs'; |
|
| 85 | - break; |
|
| 68 | + case 'ability': |
|
| 69 | + // @phpstan-ignore-next-line |
|
| 70 | + $ability = $arg->value->value; |
|
| 71 | + break; |
|
| 72 | + case 'find': |
|
| 73 | + // @phpstan-ignore-next-line |
|
| 74 | + $find = $arg->value->value; |
|
| 75 | + break; |
|
| 76 | + case 'model': |
|
| 77 | + // @phpstan-ignore-next-line |
|
| 78 | + $model = $arg->value->value; |
|
| 79 | + break; |
|
| 80 | + case 'injectArgs': |
|
| 81 | + $injected = ', array $injectedArgs'; |
|
| 82 | + break; |
|
| 83 | + case 'args': |
|
| 84 | + $args = ', array $staticArgs'; |
|
| 85 | + break; |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function generate(): GeneratedCollection |
| 31 | 31 | { |
| 32 | 32 | return new GeneratedCollection( |
| 33 | - [ new GeneratedItem( |
|
| 33 | + [new GeneratedItem( |
|
| 34 | 34 | GeneratedItem::TYPE_POLICY, |
| 35 | 35 | $this->generateString(), |
| 36 | 36 | $this->getGenerateFilename() |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | public function generateString(): string |
| 147 | 147 | { |
| 148 | - return $this->stubToString('policy', function ($stub) { |
|
| 148 | + return $this->stubToString('policy', function($stub) { |
|
| 149 | 149 | foreach ($this->type->getFields() as $field) { |
| 150 | 150 | $directives = $field->astNode->directives; |
| 151 | 151 | $this->processDirectives($field, $directives); |
@@ -168,6 +168,6 @@ discard block |
||
| 168 | 168 | |
| 169 | 169 | public function getGenerateFilename(): string |
| 170 | 170 | { |
| 171 | - return $this->getBasePath('app/Policies/'. $this->studlyName . 'Policy.php'); |
|
| 171 | + return $this->getBasePath('app/Policies/' . $this->studlyName . 'Policy.php'); |
|
| 172 | 172 | } |
| 173 | 173 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | { |
| 35 | 35 | return new GeneratedItem( |
| 36 | 36 | $name, |
| 37 | - $this->stubToString('event', function ($stub) use ($name, $type) { |
|
| 37 | + $this->stubToString('event', function($stub) use ($name, $type) { |
|
| 38 | 38 | $eventTokens = explode('\\', $name); |
| 39 | 39 | $eventClassName = array_pop($eventTokens); |
| 40 | 40 | $eventNamespace = implode('\\', $eventTokens); |
@@ -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 | ); |
@@ -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 | } |