@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function generate(): GeneratedCollection |
| 48 | 48 | { |
| 49 | 49 | return new GeneratedCollection( |
| 50 | - [ new GeneratedItem( |
|
| 50 | + [new GeneratedItem( |
|
| 51 | 51 | GeneratedItem::TYPE_MODEL, |
| 52 | 52 | $this->generateString(), |
| 53 | 53 | $this->getGenerateFilename() |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | public function generateString(): string |
| 163 | 163 | { |
| 164 | - return $this->stubToString('model', function ($stub) { |
|
| 164 | + return $this->stubToString('model', function($stub) { |
|
| 165 | 165 | $db = []; |
| 166 | 166 | |
| 167 | 167 | foreach ($this->type->getFields() as $field) { |
@@ -226,6 +226,6 @@ discard block |
||
| 226 | 226 | |
| 227 | 227 | public function getGenerateFilename(): string |
| 228 | 228 | { |
| 229 | - return $this->getBasePath('app/Models/Base'. $this->studlyName . '.php'); |
|
| 229 | + return $this->getBasePath('app/Models/Base' . $this->studlyName . '.php'); |
|
| 230 | 230 | } |
| 231 | 231 | } |
@@ -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 | } |
@@ -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/seeds/'. $this->studlyName . 'Factory.php'); |
|
| 28 | + return $this->getBasePath('database/seeds/' . $this->studlyName . 'Factory.php'); |
|
| 29 | 29 | } |
| 30 | 30 | } |
@@ -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); |
@@ -240,10 +240,10 @@ discard block |
||
| 240 | 240 | foreach ($values as $value) { |
| 241 | 241 | $indexFields[] = $value->value; |
| 242 | 242 | } |
| 243 | - $db[] = '$table->index("' . implode('", "', $indexFields) .'");'; |
|
| 243 | + $db[] = '$table->index("' . implode('", "', $indexFields) . '");'; |
|
| 244 | 244 | break; |
| 245 | 245 | case 'spatialIndex': |
| 246 | - $db[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value .'");'; |
|
| 246 | + $db[] = '$table->spatialIndex("' . $directive->arguments[0]->value->value . '");'; |
|
| 247 | 247 | break; |
| 248 | 248 | case 'rememberToken': |
| 249 | 249 | $db[] = '$table->rememberToken();'; |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | public function generateString(): string |
| 262 | 262 | { |
| 263 | - return $this->stubToString('migration', function ($stub) { |
|
| 263 | + return $this->stubToString('migration', function($stub) { |
|
| 264 | 264 | $db = []; |
| 265 | 265 | |
| 266 | 266 | foreach ($this->type->getFields() as $field) { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | |
| 311 | 311 | public function generateManyToManyTable(string $type1, string $type2): GeneratedItem |
| 312 | 312 | { |
| 313 | - $contents = $this->stubToString('migration', function ($stub) use ($type1, $type2) { |
|
| 313 | + $contents = $this->stubToString('migration', function($stub) use ($type1, $type2) { |
|
| 314 | 314 | $code = <<<EOF |
| 315 | 315 | |
| 316 | 316 | \$table->increments("id"); |
@@ -352,6 +352,6 @@ discard block |
||
| 352 | 352 | { |
| 353 | 353 | // TODO: check if a migration '_create_'. $this->lowerName exists, generate a diff from model(), generate new migration with diff |
| 354 | 354 | |
| 355 | - return $this->getBasePath('database/migrations/' . date('Y_m_d_His') . '_create_'. $basename . '_table.php'); |
|
| 355 | + return $this->getBasePath('database/migrations/' . date('Y_m_d_His') . '_create_' . $basename . '_table.php'); |
|
| 356 | 356 | } |
| 357 | 357 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public function up() |
| 18 | 18 | { |
| 19 | - Schema::create('dummytablename', function (Blueprint $table) { |
|
| 19 | + Schema::create('dummytablename', function(Blueprint $table) { |
|
| 20 | 20 | // dummyCode |
| 21 | 21 | }); |
| 22 | 22 | } |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | /** @var \Illuminate\Database\Eloquent\Factory $factory */ |
| 7 | 7 | use Faker\Generator as Faker; |
| 8 | 8 | |
| 9 | -$factory->define(App\DummyName::class, function (Faker $faker) { |
|
| 9 | +$factory->define(App\DummyName::class, function(Faker $faker) { |
|
| 10 | 10 | return (new App\Formularium\DummyName())->getRandom(); |
| 11 | 11 | }); |
@@ -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 | } |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | $this->schemaDocument = \GraphQL\Language\Parser::parse($this->schemaContent); |
| 36 | 36 | $this->schemaBuilder = new \GraphQL\Utils\BuildSchema( |
| 37 | 37 | $this->schemaDocument, |
| 38 | - function ($typeConfig, $typeDefinitionNode) { |
|
| 38 | + function($typeConfig, $typeDefinitionNode) { |
|
| 39 | 39 | /* TODO: extended datatypes |
| 40 | 40 | if ($typeConfig['name'] === 'Email') { |
| 41 | 41 | $typeConfig = array_merge($typeConfig, [ |