@@ -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 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | break; |
| 284 | 284 | |
| 285 | 285 | case 'morphedByMany': |
| 286 | - $relationship = 'NN';// TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO |
|
| 286 | + $relationship = 'NN'; // TODO Datatype_relationship::RELATIONSHIP_MANY_TO_MANY; // TODO |
|
| 287 | 287 | $typeMap = $this->parser->getSchema()->getTypeMap(); |
| 288 | 288 | |
| 289 | 289 | foreach ($typeMap as $name => $object) { |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | * @var ObjectType $object |
| 296 | 296 | */ |
| 297 | 297 | |
| 298 | - if (str_starts_with((string)$name, '__')) { |
|
| 298 | + if (str_starts_with((string) $name, '__')) { |
|
| 299 | 299 | // internal type |
| 300 | 300 | continue; |
| 301 | 301 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | continue; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $methodName = $this->getInflector()->pluralize(mb_strtolower((string)$name)); |
|
| 310 | + $methodName = $this->getInflector()->pluralize(mb_strtolower((string) $name)); |
|
| 311 | 311 | $this->class->addMethod($methodName) |
| 312 | 312 | ->setReturnType('\\Illuminate\\Database\\Eloquent\\Relations\\MorphToMany') |
| 313 | 313 | ->setPublic() |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | if ($generateRandom) { |
| 332 | 332 | $this->methodRandom->addBody( |
| 333 | 333 | '$data["' . $lowerName . '_id"] = function () {' . "\n" . |
| 334 | - ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
| 334 | + ' return factory(' . $targetClass . '::class)->create()->id;' . "\n" . |
|
| 335 | 335 | '};' |
| 336 | 336 | ); |
| 337 | 337 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 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 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | // this runs all prettier commands in parallel. |
| 98 | 98 | $run = array_reduce( |
| 99 | 99 | $writtenFiles, |
| 100 | - function ($carry, $f) use ($command) { |
|
| 100 | + function($carry, $f) use ($command) { |
|
| 101 | 101 | return $carry . '(' . $command . $f . ') & '; |
| 102 | 102 | } |
| 103 | 103 | ); |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | $target = base_path('graphql/data/' . $this->lowerName . '.graphql'); |
| 70 | 70 | $this->writeFile( |
| 71 | 71 | $target, |
| 72 | - (bool)$this->option('overwrite'), |
|
| 72 | + (bool) $this->option('overwrite'), |
|
| 73 | 73 | $graphql |
| 74 | 74 | ); |
| 75 | 75 | $this->info('Type generated at ' . $target); |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | // $blade = FrameworkComposer::getByName('Blade'); |
| 87 | 87 | |
| 88 | 88 | if ($vue !== null) { |
| 89 | - $cardFieldNames = array_map(function (Field $f) { |
|
| 89 | + $cardFieldNames = array_map(function(Field $f) { |
|
| 90 | 90 | return $f->getName(); |
| 91 | 91 | }, $this->cardFields); |
| 92 | - $tableFieldNames = array_map(function (Field $f) { |
|
| 92 | + $tableFieldNames = array_map(function(Field $f) { |
|
| 93 | 93 | return $f->getName(); |
| 94 | 94 | }, $this->tableFields); |
| 95 | 95 | |
@@ -121,12 +121,12 @@ discard block |
||
| 121 | 121 | protected function buildTemplateParameters(): void |
| 122 | 122 | { |
| 123 | 123 | $this->cardFields = $this->model->filterField( |
| 124 | - function (Field $field) { |
|
| 124 | + function(Field $field) { |
|
| 125 | 125 | return $field->getRenderable('card', false); |
| 126 | 126 | } |
| 127 | 127 | ); |
| 128 | 128 | $this->tableFields = $this->model->filterField( |
| 129 | - function (Field $field) { |
|
| 129 | + function(Field $field) { |
|
| 130 | 130 | return $field->getRenderable('table', false); |
| 131 | 131 | } |
| 132 | 132 | ); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | 'Button', |
| 139 | 139 | [ |
| 140 | 140 | Button::TYPE => 'a', |
| 141 | - Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit" ], |
|
| 141 | + Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit"], |
|
| 142 | 142 | ] |
| 143 | 143 | )->setContent( |
| 144 | 144 | '<i class="fa fa-plus"></i> Add new', |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | 'Table', |
| 182 | 182 | [ |
| 183 | 183 | Table::ROW_NAMES => array_map( |
| 184 | - function (Field $field) { |
|
| 184 | + function(Field $field) { |
|
| 185 | 185 | return $field->getRenderable(Renderable::LABEL, $field->getName()); |
| 186 | 186 | }, |
| 187 | 187 | $this->tableFields |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | true |
| 199 | 199 | ); |
| 200 | 200 | $titleFields = $this->model->filterField( |
| 201 | - function (Field $field) { |
|
| 201 | + function(Field $field) { |
|
| 202 | 202 | return $field->getRenderable('title', false); |
| 203 | 203 | } |
| 204 | 204 | ); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | 'buttonDelete' => $buttonDelete, |
| 217 | 217 | // TODO 'hasCan' => $this->model |
| 218 | 218 | 'tablelist' => $table->getRenderHTML(), |
| 219 | - 'tableItemFields' => array_keys(array_map(function (Field $f) { |
|
| 219 | + 'tableItemFields' => array_keys(array_map(function(Field $f) { |
|
| 220 | 220 | return $f->getName(); |
| 221 | 221 | }, $this->tableFields)), |
| 222 | 222 | 'titleField' => array_key_first($titleFields) ?: 'id' |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | |
| 245 | 245 | if ($mode == 'editable') { |
| 246 | 246 | $vue->setEditableTemplate( |
| 247 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 247 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 248 | 248 | return $this->templateCallback($stub, $vue, $data, $m); |
| 249 | 249 | } |
| 250 | 250 | ); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | ); |
| 259 | 259 | } else { |
| 260 | 260 | $vue->setViewableTemplate( |
| 261 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 261 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 262 | 262 | return $this->templateCallback($stub, $vue, $data, $m); |
| 263 | 263 | } |
| 264 | 264 | ); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | * card |
| 286 | 286 | */ |
| 287 | 287 | $cardFieldNames = array_map( |
| 288 | - function (Field $field) { |
|
| 288 | + function(Field $field) { |
|
| 289 | 289 | return $field->getName(); |
| 290 | 290 | }, |
| 291 | 291 | $this->cardFields |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | * table |
| 322 | 322 | */ |
| 323 | 323 | $tableFieldNames = array_map( |
| 324 | - function (Field $field) { |
|
| 324 | + function(Field $field) { |
|
| 325 | 325 | return $field->getName(); |
| 326 | 326 | }, |
| 327 | 327 | $this->tableFields |
@@ -419,14 +419,14 @@ discard block |
||
| 419 | 419 | ]; |
| 420 | 420 | |
| 421 | 421 | $import = array_map( |
| 422 | - function ($i) use ($name) { |
|
| 422 | + function($i) use ($name) { |
|
| 423 | 423 | return "import {$name}$i from './{$name}$i.vue';"; |
| 424 | 424 | }, |
| 425 | 425 | $items |
| 426 | 426 | ); |
| 427 | 427 | |
| 428 | 428 | $export = array_map( |
| 429 | - function ($i) use ($name) { |
|
| 429 | + function($i) use ($name) { |
|
| 430 | 430 | return " {$name}$i,\n"; |
| 431 | 431 | }, |
| 432 | 432 | $items |