Code Duplication    Length = 7-7 lines in 2 locations

src/Form/NestedForm.php 1 location

@@ 221-227 (lines=7) @@
218
            }
219
220
            if (($field instanceof \Encore\Admin\Form\Field\Hidden) || $value != $field->original()) {
221
                if (is_array($columns)) {
222
                    foreach ($columns as $name => $column) {
223
                        array_set($prepared, $column, $value[$name]);
224
                    }
225
                } elseif (is_string($columns)) {
226
                    array_set($prepared, $columns, $value);
227
                }
228
            }
229
        }
230

src/Form.php 1 location

@@ 780-786 (lines=7) @@
777
778
            $value = $field->prepare($value);
779
780
            if (is_array($columns)) {
781
                foreach ($columns as $name => $column) {
782
                    array_set($prepared, $column, $value[$name]);
783
                }
784
            } elseif (is_string($columns)) {
785
                array_set($prepared, $columns, $value);
786
            }
787
        }
788
789
        return $prepared;