@@ -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 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $vue, |
118 | 118 | 'Form', |
119 | 119 | 'editable', |
120 | - function (Field $f) { |
|
120 | + function(Field $f) { |
|
121 | 121 | if (!$f->getExtradata('modelFillable')) { |
122 | 122 | return false; |
123 | 123 | } |
@@ -180,12 +180,12 @@ discard block |
||
180 | 180 | protected function buildTemplateParameters(): void |
181 | 181 | { |
182 | 182 | $this->cardFields = $this->model->filterField( |
183 | - function (Field $field) { |
|
183 | + function(Field $field) { |
|
184 | 184 | return $field->getRenderable('card', false); |
185 | 185 | } |
186 | 186 | ); |
187 | 187 | $this->tableFields = $this->model->filterField( |
188 | - function (Field $field) { |
|
188 | + function(Field $field) { |
|
189 | 189 | return $field->getRenderable('table', false); |
190 | 190 | } |
191 | 191 | ); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'Button', |
198 | 198 | [ |
199 | 199 | Button::TYPE => 'a', |
200 | - Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit" ], |
|
200 | + Button::ATTRIBUTES => ['href' => "/{$this->lowerName}/edit"], |
|
201 | 201 | ] |
202 | 202 | )->setContent( |
203 | 203 | '<i class="fa fa-plus"></i> Add new', |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | 'Table', |
241 | 241 | [ |
242 | 242 | Table::ROW_NAMES => array_map( |
243 | - function (Field $field) { |
|
243 | + function(Field $field) { |
|
244 | 244 | return $field->getRenderable(Renderable::LABEL, $field->getName()); |
245 | 245 | }, |
246 | 246 | $this->tableFields |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | true |
259 | 259 | ); |
260 | 260 | $titleFields = $this->model->filterField( |
261 | - function (Field $field) { |
|
261 | + function(Field $field) { |
|
262 | 262 | return $field->getRenderable('title', false); |
263 | 263 | } |
264 | 264 | ); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | // TODO 'hasCan' => $this->model |
283 | 283 | 'spinner' => $spinner, |
284 | 284 | 'tablelist' => $table->getRenderHTML(), |
285 | - 'tableItemFields' => array_keys(array_map(function (Field $f) { |
|
285 | + 'tableItemFields' => array_keys(array_map(function(Field $f) { |
|
286 | 286 | return $f->getName(); |
287 | 287 | }, $this->tableFields)), |
288 | 288 | 'titleField' => array_key_first($titleFields) ?: 'id' |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | |
323 | 323 | if ($mode == 'editable') { |
324 | 324 | $vue->setEditableTemplate( |
325 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
325 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
326 | 326 | return $this->templateCallback($stub, $vue, $data, $m); |
327 | 327 | } |
328 | 328 | ); |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | ); |
337 | 337 | } else { |
338 | 338 | $vue->setViewableTemplate( |
339 | - function (FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
339 | + function(FrameworkVue $vue, array $data, Model $m) use ($stub) { |
|
340 | 340 | return $this->templateCallback($stub, $vue, $data, $m); |
341 | 341 | } |
342 | 342 | ); |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * card |
365 | 365 | */ |
366 | 366 | $cardFieldNames = array_map( |
367 | - function (Field $field) { |
|
367 | + function(Field $field) { |
|
368 | 368 | return $field->getName(); |
369 | 369 | }, |
370 | 370 | $this->cardFields |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | * table |
401 | 401 | */ |
402 | 402 | $tableFieldNames = array_map( |
403 | - function (Field $field) { |
|
403 | + function(Field $field) { |
|
404 | 404 | return $field->getName(); |
405 | 405 | }, |
406 | 406 | $this->tableFields |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | * item |
437 | 437 | */ |
438 | 438 | $graphqlQuery = $this->model->mapFields( |
439 | - function (Field $f) { |
|
439 | + function(Field $f) { |
|
440 | 440 | return \Modelarium\Frontend\Util::fieldShow($f) ? $f->toGraphqlQuery() : null; |
441 | 441 | } |
442 | 442 | ); |
@@ -505,14 +505,14 @@ discard block |
||
505 | 505 | ]; |
506 | 506 | |
507 | 507 | $import = array_map( |
508 | - function ($i) use ($name) { |
|
508 | + function($i) use ($name) { |
|
509 | 509 | return "import {$name}$i from './{$name}$i.vue';"; |
510 | 510 | }, |
511 | 511 | $items |
512 | 512 | ); |
513 | 513 | |
514 | 514 | $export = array_map( |
515 | - function ($i) use ($name) { |
|
515 | + function($i) use ($name) { |
|
516 | 516 | return " {$name}$i,\n"; |
517 | 517 | }, |
518 | 518 | $items |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | $this->templateFile( |
540 | 540 | $this->stubDir . "/routes.mustache.js", |
541 | 541 | // TODO: document routeBase renderable parameter |
542 | - [ 'routeName' => $this->model->getRenderable('routeBase', $this->lowerName) ] |
|
542 | + ['routeName' => $this->model->getRenderable('routeBase', $this->lowerName)] |
|
543 | 543 | ), |
544 | 544 | $path |
545 | 545 | ) |