Code Duplication    Length = 7-7 lines in 2 locations

src/Form/NestedForm.php 1 location

@@ 279-285 (lines=7) @@
276
            }
277
278
            if (($field instanceof \Encore\Admin\Form\Field\Hidden) || $value != $field->original()) {
279
                if (is_array($columns)) {
280
                    foreach ($columns as $name => $column) {
281
                        Arr::set($prepared, $column, $value[$name]);
282
                    }
283
                } elseif (is_string($columns)) {
284
                    Arr::set($prepared, $columns, $value);
285
                }
286
            }
287
        }
288

src/Form.php 1 location

@@ 887-893 (lines=7) @@
884
885
            $value = $field->prepare($value);
886
887
            if (is_array($columns)) {
888
                foreach ($columns as $name => $column) {
889
                    Arr::set($prepared, $column, $value[$name]);
890
                }
891
            } elseif (is_string($columns)) {
892
                Arr::set($prepared, $columns, $value);
893
            }
894
        }
895
896
        return $prepared;