@@ -35,11 +35,11 @@ |
||
35 | 35 | { |
36 | 36 | $action = new static($fieldList); |
37 | 37 | $action->setForm($form); |
38 | - $action->setConsumerGenerateCallback(function () use ($form) { |
|
39 | - return GetConsumerForForm::for($form)->handle(); |
|
38 | + $action->setConsumerGenerateCallback(function() use ($form) { |
|
39 | + return GetConsumerForForm::for ($form)->handle(); |
|
40 | 40 | }); |
41 | 41 | |
42 | - $action->setConsumerConfigGenerateCallback(function () use ($action) { |
|
42 | + $action->setConsumerConfigGenerateCallback(function() use ($action) { |
|
43 | 43 | return GetConsumerConfig::forConsumer($action->getConsumer())->handle(); |
44 | 44 | }); |
45 | 45 |
@@ -36,7 +36,9 @@ |
||
36 | 36 | $action = new static($fieldList); |
37 | 37 | $action->setForm($form); |
38 | 38 | $action->setConsumerGenerateCallback(function () use ($form) { |
39 | - return GetConsumerForForm::for($form)->handle(); |
|
39 | + return GetConsumerForForm::for($form) { |
|
40 | + ->handle(); |
|
41 | + } |
|
40 | 42 | }); |
41 | 43 | |
42 | 44 | $action->setConsumerConfigGenerateCallback(function () use ($action) { |
@@ -87,7 +87,7 @@ |
||
87 | 87 | protected function bootFormbuilderFieldsControllerTrait() |
88 | 88 | { |
89 | 89 | $this->after( |
90 | - function () { |
|
90 | + function() { |
|
91 | 91 | $this->registerFormbuilderViewPaths(); |
92 | 92 | } |
93 | 93 | ); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | { |
13 | 13 | use HasForm; |
14 | 14 | |
15 | - public function handle(): Associated|array |
|
15 | + public function handle(): Associated | array |
|
16 | 16 | { |
17 | 17 | $fields = $this->form->getFormFields(); |
18 | 18 | $count = is_object($fields) ? $fields->count() : count($fields); |
@@ -26,13 +26,13 @@ |
||
26 | 26 | <?php foreach ($roles as $role) { ?> |
27 | 27 | <?php |
28 | 28 | $fields = $designer->getAvailable($role)->all(); |
29 | - $id = 'fields-available-'.$role; |
|
29 | + $id = 'fields-available-' . $role; |
|
30 | 30 | ?> |
31 | 31 | <div class="accordion-item"> |
32 | 32 | <h2 class="accordion-header"> |
33 | 33 | <button class="accordion-button" type="button" data-bs-toggle="collapse" |
34 | 34 | data-bs-target="#<?= $id; ?>" aria-expanded="true" aria-controls="<?= $id; ?>"> |
35 | - <?= $consumer->getManager()->getLabel('forms.role.'.$role) ?> |
|
35 | + <?= $consumer->getManager()->getLabel('forms.role.' . $role) ?> |
|
36 | 36 | </button> |
37 | 37 | </h2> |
38 | 38 | <div id="<?= $id; ?>" class="accordion-collapse collapse show" |
@@ -19,9 +19,9 @@ |
||
19 | 19 | $object = $listTypes->get($value); |
20 | 20 | if ($object === null) { |
21 | 21 | throw new Exception( |
22 | - 'Field type not found: '.$name.' - '.$value |
|
23 | - .'. Available classes: '.implode(', ', array_keys($listTypes->all())) |
|
24 | - .'. Available names: '.implode(', ', array_keys($listTypes->classmap())) |
|
22 | + 'Field type not found: ' . $name . ' - ' . $value |
|
23 | + .'. Available classes: ' . implode(', ', array_keys($listTypes->all())) |
|
24 | + .'. Available names: ' . implode(', ', array_keys($listTypes->classmap())) |
|
25 | 25 | ); |
26 | 26 | } |
27 | 27 | $object->setItem($this); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | <?php if ($fields) { ?> |
22 | 22 | <div class="form-panel"> |
23 | 23 | <div class="header"> |
24 | - <?= $manager->getLabel('existing.'.$role) ?> |
|
24 | + <?= $manager->getLabel('existing.' . $role) ?> |
|
25 | 25 | </div> |
26 | 26 | <div class="fields-body"> |
27 | 27 | <?= $this->load( |
@@ -52,8 +52,8 @@ |
||
52 | 52 | <li> |
53 | 53 | <a href="<?= $field->compileURL('delete'); ?>" class="dropdown-item action-delete" |
54 | 54 | onclick="return confirm('<?= translator()->trans( |
55 | - 'general.messages.confirm' |
|
56 | - ); ?>');"> |
|
55 | + 'general.messages.confirm' |
|
56 | + ); ?>');"> |
|
57 | 57 | <i class="far fa-trash-alt"></i> |
58 | 58 | <?= translator()->trans('delete'); ?> |
59 | 59 | </a> |
@@ -13,7 +13,7 @@ |
||
13 | 13 | $form = Mockery::mock(FormModel::class) |
14 | 14 | ->makePartial(); |
15 | 15 | |
16 | - $form->shouldReceive('getModelForRole')->andReturnUsing(function ($role) use ($form) { |
|
16 | + $form->shouldReceive('getModelForRole')->andReturnUsing(function($role) use ($form) { |
|
17 | 17 | return $form->getModel(); |
18 | 18 | }); |
19 | 19 |
@@ -42,9 +42,13 @@ |
||
42 | 42 | |
43 | 43 | protected function getFormValueRecord($model) |
44 | 44 | { |
45 | - $values = FindValuesByFormConsumer::for($this->getItem()->getFormBuilder(), $model)->handle(); |
|
45 | + $values = FindValuesByFormConsumer::for($this->getItem()->getFormBuilder(), $model) { |
|
46 | + ->handle(); |
|
47 | + } |
|
46 | 48 | |
47 | - return FindOrCreateFormValueFromList::for($values)->fieldValue($this->getItem()); |
|
49 | + return FindOrCreateFormValueFromList::for($values) { |
|
50 | + ->fieldValue($this->getItem()); |
|
51 | + } |
|
48 | 52 | } |
49 | 53 | |
50 | 54 | /** |
@@ -42,9 +42,9 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function getFormValueRecord($model) |
44 | 44 | { |
45 | - $values = FindValuesByFormConsumer::for($this->getItem()->getFormBuilder(), $model)->handle(); |
|
45 | + $values = FindValuesByFormConsumer::for ($this->getItem()->getFormBuilder(), $model)->handle(); |
|
46 | 46 | |
47 | - return FindOrCreateFormValueFromList::for($values)->fieldValue($this->getItem()); |
|
47 | + return FindOrCreateFormValueFromList::for ($values)->fieldValue($this->getItem()); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -102,6 +102,6 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function generateFormName(): string |
104 | 104 | { |
105 | - return $this->getName().'-'.sha1($this->getItem()->id ?? ''); |
|
105 | + return $this->getName() . '-' . sha1($this->getItem()->id ?? ''); |
|
106 | 106 | } |
107 | 107 | } |