@@ -31,7 +31,9 @@ |
||
31 | 31 | |
32 | 32 | public static function forForm($form) |
33 | 33 | { |
34 | - $consumer = GetConsumerForForm::for($form)->handle(); |
|
34 | + $consumer = GetConsumerForForm::for($form) { |
|
35 | + ->handle(); |
|
36 | + } |
|
35 | 37 | |
36 | 38 | return self::forConsumer($consumer); |
37 | 39 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | public static function forForm($form) |
33 | 33 | { |
34 | - $consumer = GetConsumerForForm::for($form)->handle(); |
|
34 | + $consumer = GetConsumerForForm::for ($form)->handle(); |
|
35 | 35 | |
36 | 36 | return self::forConsumer($consumer); |
37 | 37 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $action = new static(); |
42 | 42 | $action->setConsumer($consumer); |
43 | 43 | $action->setConsumerConfig($consumerConfig); |
44 | - $action->setConsumerConfigGenerateCallback(function () use ($consumer) { |
|
44 | + $action->setConsumerConfigGenerateCallback(function() use ($consumer) { |
|
45 | 45 | return GetConsumerConfig::forConsumer($consumer)->handle(); |
46 | 46 | }); |
47 | 47 |
@@ -118,6 +118,6 @@ |
||
118 | 118 | */ |
119 | 119 | public function getFormName() |
120 | 120 | { |
121 | - return $this->getName().'-'.sha1($this->getItem()->id ?? ''); |
|
121 | + return $this->getName() . '-' . sha1($this->getItem()->id ?? ''); |
|
122 | 122 | } |
123 | 123 | } |
@@ -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 | ); |
@@ -52,8 +52,8 @@ |
||
52 | 52 | <li> |
53 | 53 | <a href="<?= $field->compileURL('delete'); ?>" class="dropdown-item" |
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> |
@@ -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( |