@@ -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 | } |
@@ -34,8 +34,8 @@ |
||
34 | 34 | public static function forForm(Form $form, $fieldsCollection = null): static |
35 | 35 | { |
36 | 36 | $action = new static($form, $fieldsCollection); |
37 | - $action->setConsumer(GetConsumerForForm::for($form)->handle()); |
|
38 | - $action->setConsumerConfigGenerateCallback(function () use ($action) { |
|
37 | + $action->setConsumer(GetConsumerForForm::for ($form)->handle()); |
|
38 | + $action->setConsumerConfigGenerateCallback(function() use ($action) { |
|
39 | 39 | return GetConsumerConfig::forConsumer($action->getConsumer())->handle(); |
40 | 40 | }); |
41 | 41 |
@@ -34,7 +34,9 @@ |
||
34 | 34 | public static function forForm(Form $form, $fieldsCollection = null): static |
35 | 35 | { |
36 | 36 | $action = new static($form, $fieldsCollection); |
37 | - $action->setConsumer(GetConsumerForForm::for($form)->handle()); |
|
37 | + $action->setConsumer(GetConsumerForForm::for($form) { |
|
38 | + ->handle()); |
|
39 | + } |
|
38 | 40 | $action->setConsumerConfigGenerateCallback(function () use ($action) { |
39 | 41 | return GetConsumerConfig::forConsumer($action->getConsumer())->handle(); |
40 | 42 | }); |
@@ -109,18 +109,18 @@ |
||
109 | 109 | public function populateFromSibling($sibling) |
110 | 110 | { |
111 | 111 | foreach ([ |
112 | - 'role', |
|
113 | - 'label', |
|
114 | - 'label_intern', |
|
115 | - 'help', |
|
116 | - 'options', |
|
117 | - 'type', |
|
118 | - 'listing', |
|
119 | - 'visible', |
|
120 | - 'mandatory', |
|
121 | - 'filter', |
|
122 | - 'pos', |
|
123 | - ] as $col) { |
|
112 | + 'role', |
|
113 | + 'label', |
|
114 | + 'label_intern', |
|
115 | + 'help', |
|
116 | + 'options', |
|
117 | + 'type', |
|
118 | + 'listing', |
|
119 | + 'visible', |
|
120 | + 'mandatory', |
|
121 | + 'filter', |
|
122 | + 'pos', |
|
123 | + ] as $col) { |
|
124 | 124 | $this->setPropertyValue($col, $sibling->getPropertyRaw($col)); |
125 | 125 | } |
126 | 126 | $this->initOptions(); |