@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | $writtenFiles = $this->writeFiles( |
| 157 | 157 | $collection, |
| 158 | 158 | $basepath, |
| 159 | - function (GeneratedItem $i) use ($match) { |
|
| 160 | - if ((bool)$this->option('overwrite') === true) { |
|
| 159 | + function(GeneratedItem $i) use ($match) { |
|
| 160 | + if ((bool) $this->option('overwrite') === true) { |
|
| 161 | 161 | return true; |
| 162 | 162 | } |
| 163 | - if ((bool)$this->option('overwrite-graphql') === true) { |
|
| 163 | + if ((bool) $this->option('overwrite-graphql') === true) { |
|
| 164 | 164 | if ( |
| 165 | 165 | StringUtil::endsWith($i->filename, '.graphql') |
| 166 | 166 | ) { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | // this runs all prettier commands in parallel. |
| 190 | 190 | $run = array_reduce( |
| 191 | 191 | $writtenFiles, |
| 192 | - function ($carry, $f) use ($command) { |
|
| 192 | + function($carry, $f) use ($command) { |
|
| 193 | 193 | return $carry . '(' . $command . $f . ') & '; |
| 194 | 194 | } |
| 195 | 195 | ); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | throw new Exception("You must provide at least one field to a full text index"); |
| 24 | 24 | } |
| 25 | 25 | $generator->postCreateCode[] = "DB::statement('ALTER TABLE " . |
| 26 | - $generator->getTableName() . |
|
| 26 | + $generator->getTableName() . |
|
| 27 | 27 | " ADD FULLTEXT fulltext_index (\"" . |
| 28 | 28 | implode('", "', $indexFields) . |
| 29 | 29 | "\")');"; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | return new GeneratedCollection( |
| 34 | - [ new GeneratedItem( |
|
| 34 | + [new GeneratedItem( |
|
| 35 | 35 | GeneratedItem::TYPE_FACTORY, |
| 36 | 36 | $this->generateString(), |
| 37 | 37 | $this->getGenerateFilename() |
@@ -50,6 +50,6 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | public function getGenerateFilename(): string |
| 52 | 52 | { |
| 53 | - return $this->getBasePath('database/factories/'. $this->studlyName . 'Factory.php'); |
|
| 53 | + return $this->getBasePath('database/factories/' . $this->studlyName . 'Factory.php'); |
|
| 54 | 54 | } |
| 55 | 55 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | 'implements' => implode( |
| 23 | 23 | ', ', |
| 24 | 24 | array_map( |
| 25 | - function ($i) { |
|
| 25 | + function($i) { |
|
| 26 | 26 | return Str::studly($i) . 'DirectiveInterface'; |
| 27 | 27 | }, |
| 28 | 28 | $processors |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // Script example.php |
| 63 | -$longopts = array( |
|
| 63 | +$longopts = array( |
|
| 64 | 64 | "name:", |
| 65 | 65 | "processors:" |
| 66 | 66 | ); |
@@ -60,18 +60,18 @@ |
||
| 60 | 60 | $targetSingle = mb_strtolower($generator->getInflector()->singularize($datatype->getTarget())); |
| 61 | 61 | $targetPlural = $datatype->getTargetTable(); |
| 62 | 62 | switch ($datatype->getRelationship()) { |
| 63 | - case RelationshipFactory::RELATIONSHIP_ONE_TO_ONE: |
|
| 64 | - case RelationshipFactory::MORPH_ONE_TO_ONE: |
|
| 65 | - $target = $targetSingle; |
|
| 66 | - break; |
|
| 67 | - case RelationshipFactory::RELATIONSHIP_ONE_TO_MANY: |
|
| 68 | - case RelationshipFactory::MORPH_ONE_TO_MANY: |
|
| 69 | - $target = $datatype->getIsInverse() ? $targetSingle : $targetPlural; |
|
| 70 | - break; |
|
| 71 | - case RelationshipFactory::RELATIONSHIP_MANY_TO_MANY: |
|
| 72 | - case RelationshipFactory::MORPH_MANY_TO_MANY: |
|
| 73 | - $target = $targetPlural; |
|
| 74 | - break; |
|
| 63 | + case RelationshipFactory::RELATIONSHIP_ONE_TO_ONE: |
|
| 64 | + case RelationshipFactory::MORPH_ONE_TO_ONE: |
|
| 65 | + $target = $targetSingle; |
|
| 66 | + break; |
|
| 67 | + case RelationshipFactory::RELATIONSHIP_ONE_TO_MANY: |
|
| 68 | + case RelationshipFactory::MORPH_ONE_TO_MANY: |
|
| 69 | + $target = $datatype->getIsInverse() ? $targetSingle : $targetPlural; |
|
| 70 | + break; |
|
| 71 | + case RelationshipFactory::RELATIONSHIP_MANY_TO_MANY: |
|
| 72 | + case RelationshipFactory::MORPH_MANY_TO_MANY: |
|
| 73 | + $target = $targetPlural; |
|
| 74 | + break; |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | $generator->with[] = $target; |
@@ -233,7 +233,7 @@ |
||
| 233 | 233 | $this->fModel->appendExtradata( |
| 234 | 234 | new Extradata( |
| 235 | 235 | 'hasCan', |
| 236 | - [ new ExtradataParameter('value', true) ] |
|
| 236 | + [new ExtradataParameter('value', true)] |
|
| 237 | 237 | ) |
| 238 | 238 | ); |
| 239 | 239 | return; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | $vue, |
| 70 | 70 | 'Form', |
| 71 | 71 | 'editable', |
| 72 | - function (Field $f) { |
|
| 72 | + function(Field $f) { |
|
| 73 | 73 | if (!$f->getExtradata('modelFillable')) { |
| 74 | 74 | return false; |
| 75 | 75 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | Button::TYPE => ($hasVuex ? 'router-link' : 'a'), |
| 94 | 94 | Button::ATTRIBUTES => [ |
| 95 | 95 | $targetAttribute => "/{$routeBase}/edit", |
| 96 | - ] + ($hasCan ? [ "v-if" => 'can.create' ]: []), |
|
| 96 | + ] + ($hasCan ? ["v-if" => 'can.create'] : []), |
|
| 97 | 97 | ] |
| 98 | 98 | )->setContent( |
| 99 | 99 | '<i class="fa fa-plus"></i> Add new', |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | Button::TYPE => ($hasVuex ? 'router-link' : 'a'), |
| 108 | 108 | Button::ATTRIBUTES => [ |
| 109 | 109 | $targetAttribute => "'/{$routeBase}/' + model.{$keyAttribute} + '/edit'", |
| 110 | - ] + ($hasCan ? [ "v-if" => 'can.edit' ]: []), |
|
| 110 | + ] + ($hasCan ? ["v-if" => 'can.edit'] : []), |
|
| 111 | 111 | ] |
| 112 | 112 | )->setContent( |
| 113 | 113 | '<i class="fa fa-pencil"></i> Edit', |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | Button::ATTRIBUTES => [ |
| 124 | 124 | 'href' => '#', |
| 125 | 125 | '@click.prevent' => 'remove', |
| 126 | - ] + ($hasCan ? [ "v-if" => 'can.delete' ]: []), |
|
| 126 | + ] + ($hasCan ? ["v-if" => 'can.delete'] : []), |
|
| 127 | 127 | ] |
| 128 | 128 | )->setContent( |
| 129 | 129 | '<i class="fa fa-trash"></i> Delete', |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | 'required' => true |
| 213 | 213 | ] |
| 214 | 214 | ]; |
| 215 | - $cardFieldNames = array_map(function (Field $f) { |
|
| 215 | + $cardFieldNames = array_map(function(Field $f) { |
|
| 216 | 216 | return $f->getName(); |
| 217 | 217 | }, $this->generator->getCardFields()); |
| 218 | 218 | $vueCode->setExtraProps($extraprops); |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | ] |
| 241 | 241 | ]; |
| 242 | 242 | $vueCode->setExtraProps($extraprops); |
| 243 | - $cardFieldNames = array_map(function (Field $f) { |
|
| 243 | + $cardFieldNames = array_map(function(Field $f) { |
|
| 244 | 244 | return $f->getName(); |
| 245 | 245 | }, $this->generator->getCardFields()); |
| 246 | 246 | foreach ($this->generator->getCardFields() as $f) { |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | public function vueTableItem(FrameworkVue $vue): void |
| 258 | 258 | { |
| 259 | 259 | $vueCode = $vue->getVueCode(); |
| 260 | - $tableFieldNames = array_map(function (Field $f) { |
|
| 260 | + $tableFieldNames = array_map(function(Field $f) { |
|
| 261 | 261 | return $f->getName(); |
| 262 | 262 | }, $this->generator->getTableFields()); |
| 263 | 263 | $extraprops = [ |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | |
| 300 | 300 | if ($mode == 'editable') { |
| 301 | 301 | $vue->setEditableTemplate( |
| 302 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 302 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 303 | 303 | return $this->generator->templateCallback($stub, $vue, $data, $m); |
| 304 | 304 | } |
| 305 | 305 | ); |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | ); |
| 314 | 314 | } else { |
| 315 | 315 | $vue->setViewableTemplate( |
| 316 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 316 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
| 317 | 317 | return $this->generator->templateCallback($stub, $vue, $data, $m); |
| 318 | 318 | } |
| 319 | 319 | ); |
@@ -345,14 +345,14 @@ discard block |
||
| 345 | 345 | ]; |
| 346 | 346 | |
| 347 | 347 | $import = array_map( |
| 348 | - function ($i) use ($name) { |
|
| 348 | + function($i) use ($name) { |
|
| 349 | 349 | return "import {$name}$i from './{$name}$i.vue';"; |
| 350 | 350 | }, |
| 351 | 351 | $items |
| 352 | 352 | ); |
| 353 | 353 | |
| 354 | 354 | $export = array_map( |
| 355 | - function ($i) use ($name) { |
|
| 355 | + function($i) use ($name) { |
|
| 356 | 356 | return " {$name}$i,\n"; |
| 357 | 357 | }, |
| 358 | 358 | $items |
@@ -133,12 +133,12 @@ discard block |
||
| 133 | 133 | public function buildTemplateParameters(): void |
| 134 | 134 | { |
| 135 | 135 | $this->cardFields = $this->fModel->filterField( |
| 136 | - function (Field $field) { |
|
| 136 | + function(Field $field) { |
|
| 137 | 137 | return $field->getRenderable('card', false); |
| 138 | 138 | } |
| 139 | 139 | ); |
| 140 | 140 | $this->tableFields = $this->fModel->filterField( |
| 141 | - function (Field $field) { |
|
| 141 | + function(Field $field) { |
|
| 142 | 142 | return $field->getRenderable('table', false); |
| 143 | 143 | } |
| 144 | 144 | ); |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | 'Table', |
| 195 | 195 | [ |
| 196 | 196 | Table::ROW_NAMES => array_map( |
| 197 | - function (Field $field) { |
|
| 197 | + function(Field $field) { |
|
| 198 | 198 | return $field->getRenderable(Renderable::LABEL, $field->getName()); |
| 199 | 199 | }, |
| 200 | 200 | $this->tableFields |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | true |
| 213 | 213 | ); |
| 214 | 214 | $titleFields = $this->fModel->filterField( |
| 215 | - function (Field $field) { |
|
| 215 | + function(Field $field) { |
|
| 216 | 216 | return $field->getRenderable('title', false); |
| 217 | 217 | } |
| 218 | 218 | ); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | 'keyAttribute' => $this->keyAttribute, |
| 240 | 240 | 'spinner' => $spinner, |
| 241 | 241 | 'tablelist' => $table->getRenderHTML(), |
| 242 | - 'tableItemFields' => array_keys(array_map(function (Field $f) { |
|
| 242 | + 'tableItemFields' => array_keys(array_map(function(Field $f) { |
|
| 243 | 243 | return $f->getName(); |
| 244 | 244 | }, $this->tableFields)), |
| 245 | 245 | 'typeTitle' => $this->studlyName, |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * card |
| 318 | 318 | */ |
| 319 | 319 | $cardFieldNames = array_map( |
| 320 | - function (Field $field) { |
|
| 320 | + function(Field $field) { |
|
| 321 | 321 | return $field->getName(); |
| 322 | 322 | }, |
| 323 | 323 | $this->cardFields |
@@ -330,8 +330,8 @@ discard block |
||
| 330 | 330 | $filtersQuery = ', ' . join( |
| 331 | 331 | ', ', |
| 332 | 332 | array_map( |
| 333 | - function ($item) { |
|
| 334 | - return '$' . $item['name'] . ': ' . $item['type'] . ($item['required'] ? '!' : ''); |
|
| 333 | + function($item) { |
|
| 334 | + return '$' . $item['name'] . ': ' . $item['type'] . ($item['required'] ? '!' : ''); |
|
| 335 | 335 | }, |
| 336 | 336 | $filters |
| 337 | 337 | ) |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $filtersParams = ', ' . join( |
| 340 | 340 | ', ', |
| 341 | 341 | array_map( |
| 342 | - function ($item) { |
|
| 342 | + function($item) { |
|
| 343 | 343 | return $item['name'] . ': $' . $item['name']; |
| 344 | 344 | }, |
| 345 | 345 | $filters |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | * table |
| 379 | 379 | */ |
| 380 | 380 | $tableFieldNames = array_map( |
| 381 | - function (Field $field) { |
|
| 381 | + function(Field $field) { |
|
| 382 | 382 | return $field->getName(); |
| 383 | 383 | }, |
| 384 | 384 | $this->tableFields |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | * item |
| 415 | 415 | */ |
| 416 | 416 | $graphqlQuery = $this->fModel->mapFields( |
| 417 | - function (Field $f) { |
|
| 417 | + function(Field $f) { |
|
| 418 | 418 | return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null; |
| 419 | 419 | } |
| 420 | 420 | ); |