@@ -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,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 getFormName(): string |
| 104 | 104 | { |
| 105 | - return $this->getName().'-'.sha1($this->getItem()->id ?? ''); |
|
| 105 | + return $this->getName() . '-' . sha1($this->getItem()->id ?? ''); |
|
| 106 | 106 | } |
| 107 | 107 | } |
@@ -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 | /** |
@@ -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(); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | { |
| 10 | 10 | protected $list; |
| 11 | 11 | |
| 12 | - public static function for(FormValuesConsumerList $list) |
|
| 12 | + public static function for (FormValuesConsumerList $list) |
|
| 13 | 13 | { |
| 14 | 14 | $action = new static(); |
| 15 | 15 | $action->list = $list; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $this->list = new FormValuesConsumerList($form, $consumer); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - public static function for($form, $consumer) |
|
| 23 | + public static function for ($form, $consumer) |
|
| 24 | 24 | { |
| 25 | 25 | return new static($form, $consumer); |
| 26 | 26 | } |
@@ -50,9 +50,9 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | return [ |
| 52 | 52 | 'where' => [ |
| 53 | - ['id_form = ?', $this->list->getForm()->id,], |
|
| 54 | - ['consumer = ?', $consumer->getManager()->getMorphName(),], |
|
| 55 | - ['consumer_id = ?', $consumer->id,], |
|
| 53 | + ['id_form = ?', $this->list->getForm()->id, ], |
|
| 54 | + ['consumer = ?', $consumer->getManager()->getMorphName(), ], |
|
| 55 | + ['consumer_id = ?', $consumer->id, ], |
|
| 56 | 56 | ], |
| 57 | 57 | ]; |
| 58 | 58 | } |