Skip to content

Commit d23c879

Browse files
committed
Remove array helper intersectKeyRecursive
1 parent b29462b commit d23c879

File tree

2 files changed

+0
-209
lines changed

2 files changed

+0
-209
lines changed

system/Helpers/Array/ArrayHelper.php

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -315,27 +315,4 @@ public static function sortValuesByNatural(array &$array, $sortByIndex = null):
315315
return strnatcmp((string) $currentValue, (string) $nextValue);
316316
});
317317
}
318-
319-
/**
320-
* Returns a new array from $target with the keys that are in $original
321-
*
322-
* @param array<string, array<string,mixed>|string|null> $target
323-
* @param array<string, array<string,mixed>|string|null> $original
324-
*
325-
* @return array<string, array<string,mixed>|string|null>
326-
*/
327-
public static function intersectKeyRecursive(array $target, array $original): array
328-
{
329-
$result = [];
330-
331-
foreach ($target as $key => $value) {
332-
if (is_array($value) && isset($original[$key]) && is_array($original[$key])) {
333-
$result[$key] = self::intersectKeyRecursive($value, $original[$key]);
334-
} elseif (array_key_exists($key, $original)) {
335-
$result[$key] = $value;
336-
}
337-
}
338-
339-
return $result;
340-
}
341318
}

tests/system/Helpers/Array/ArrayHelperIntersectKeyRecursiveTest.php

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)