Code Duplication    Length = 14-14 lines in 2 locations

src/Form/Field/HasMany.php 1 location

@@ 238-251 (lines=14) @@
235
                }, $newColumn);
236
                $rules = array_clean_merge($rules, $newRules);
237
238
                $newInput = array_map(function ($v) use ($availInput) {
239
                    list($r, $k, $c) = explode('.', $v);
240
                    //Fix ResetInput Function! A Headache Implementation!
241
                    $col = explode(':', $c)[0];
242
                    if (!array_key_exists($col, $availInput[$k])) {
243
                        return [$v => null];
244
                    }
245
246
                    if (is_array($availInput[$k][$col])) {
247
                        return array_key_attach_str($availInput[$k][$col], $v, ':');
248
                    }
249
250
                    return [$v => $availInput[$k][$col]];
251
                }, $newColumn);
252
                $newInputs = array_clean_merge($newInputs, $newInput);
253
254
                $newAttributes = array_map(function ($v) use ($field, $availInput) {

src/Form/Field/Embeds.php 1 location

@@ 341-354 (lines=14) @@
338
                return !$k ? "{$rel}.{$v}" : "{$rel}.{$v}:{$k}";
339
            }, array_keys($columns), array_values($columns));
340
341
            $newInput = array_map(function ($v) use ($availInput) {
342
                list($k, $c) = explode('.', $v);
343
                //Fix ResetInput Function! A Headache Implementation!
344
                $col = explode(':', $c)[0];
345
                if (!array_key_exists($col, $availInput[$k])) {
346
                    return [$v => null];
347
                }
348
349
                if (array_key_exists($col, $availInput[$k]) && is_array($availInput[$k][$col])) {
350
                    return array_key_attach_str($availInput[$k][$col], $v, ':');
351
                }
352
353
                return [$v => $availInput[$k][$col]];
354
            }, $newColumn);
355
            $newInputs = array_clean_merge($newInputs, $newInput);
356
        }
357