Code Duplication    Length = 11-11 lines in 2 locations

src/Form/Field/HasMany.php 1 location

@@ 13-23 (lines=11) @@
10
use Illuminate\Database\Eloquent\Relations\MorphMany;
11
use Illuminate\Support\Facades\Validator;
12
13
if (!function_exists('Encore\Admin\Form\Field\array_key_attach_str')) {
14
    function array_key_attach_str(array $a, string $b, string $c = '.')
15
    {
16
        return call_user_func_array(
17
            'array_merge',
18
            array_map(function ($u, $v) use ($b, $c) {
19
                return ["{$b}{$c}{$u}" => $v];
20
            }, array_keys($a), array_values($a))
21
        );
22
    }
23
}
24
25
if (!function_exists('Encore\Admin\Form\Field\array_clean_merge')) {
26
    function array_clean_merge(array $a, $b)

src/Form/Field/Embeds.php 1 location

@@ 10-20 (lines=11) @@
7
use Illuminate\Support\Facades\Validator;
8
use Illuminate\Support\Str;
9
10
if (!function_exists('Encore\Admin\Form\Field\array_key_attach_str')) {
11
    function array_key_attach_str(array $a, string $b, string $c = '.')
12
    {
13
        return call_user_func_array(
14
            'array_merge',
15
            array_map(function ($u, $v) use ($b, $c) {
16
                return ["{$b}{$c}{$u}" => $v];
17
            }, array_keys($a), array_values($a))
18
        );
19
    };
20
}
21
22
if (!function_exists('Encore\Admin\Form\Field\array_clean_merge')) {
23
    function array_clean_merge(array $a, $b)