Skip to content

Commit

Permalink
Fix: Allow mixed value in Carbon.Array.hasValue
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Aug 12, 2024
1 parent 3943968 commit d3e89f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Classes/EelHelper/ArrayHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ public function hasKey(iterable $array, string $key): bool
* Returns a boolean if the array has a specific value
*
* @param iterable $array
* @param string $key
* @param mixed $value
* @return bool
*/
public function hasValue(iterable $array, string $key): bool
public function hasValue(iterable $array, $value): bool
{
if ($array instanceof Traversable) {
$array = iterator_to_array($array);
}
return in_array($key, $array);
return in_array($value, $array);
}

/**
Expand Down

0 comments on commit d3e89f2

Please sign in to comment.