Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Remove unused global function array_filter_recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
Omranic committed Jun 10, 2023
1 parent 2aaa3bb commit f254ed3
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/Support/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,6 @@ function array_trim_recursive($values, $charlist = " \t\n\r\0\x0B")
}
}

if (! function_exists('array_filter_recursive')) {
/**
* Recursively filter empty strings and null elements of the given array.
*
* @param array $values
* @param bool $strOnly
*
* @return mixed
*/
function array_filter_recursive($values, $strOnly = true)
{
foreach ($values as &$value) {
if (is_array($value)) {
$value = array_filter_recursive($value);
}
}

return ! $strOnly ? array_filter($values) : array_filter($values, function ($item) {
return ! is_null($item) && ! ((is_string($item) || is_array($item)) && empty($item));
});
}
}

if (! function_exists('array_diff_assoc_recursive')) {
/**
* Computes the recursive difference of arrays with additional index check.
Expand Down

0 comments on commit f254ed3

Please sign in to comment.