Skip to content

Commit

Permalink
Update Collection::hasAny (#53963)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeftaAtSiip authored Dec 18, 2024
1 parent 21868f9 commit 9100b08
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ public function has($key)
/**
* Determine if any of the keys exist in the collection.
*
* @param mixed $key
* @param TKey|array<array-key, TKey> $key
* @return bool
*/
public function hasAny($key)
Expand All @@ -601,7 +601,7 @@ public function hasAny($key)
$keys = is_array($key) ? $key : func_get_args();

foreach ($keys as $value) {
if ($this->has($value)) {
if (array_key_exists($value, $this->items)) {
return true;
}
}
Expand Down

0 comments on commit 9100b08

Please sign in to comment.