Skip to content

Commit

Permalink
Fix the array_find call
Browse files Browse the repository at this point in the history
  • Loading branch information
alextselegidis committed Apr 15, 2024
1 parent eba1eb2 commit b292e10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion application/helpers/array_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function array_find(array $array, callable $callback): mixed
throw new InvalidArgumentException('No filter function provided.');
}

return array_filter($array, $callback)[0] ?? null;
return array_values(array_filter($array, $callback))[0] ?? null;
}
}

Expand Down

0 comments on commit b292e10

Please sign in to comment.