Skip to content

Commit

Permalink
Improve Array helper:
Browse files Browse the repository at this point in the history
- check if filter is a callable
  • Loading branch information
webeweb committed Aug 16, 2022
1 parent ea32a07 commit f1e39f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types/Helper/ArrayHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function filterBy(array $array, array $filters): array {

foreach ($filters as $callback) {

if (false === $callback($current)) {
if (true === is_callable($callback) && false === $callback($current)) {

$include = false;
break;
Expand Down

0 comments on commit f1e39f5

Please sign in to comment.