Skip to content

Commit f3ed42a

Browse files
authored
Update Collection::hasAny (#53963)
1 parent df19866 commit f3ed42a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Illuminate/Collections/Collection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ public function has($key)
589589
/**
590590
* Determine if any of the keys exist in the collection.
591591
*
592-
* @param mixed $key
592+
* @param TKey|array<array-key, TKey> $key
593593
* @return bool
594594
*/
595595
public function hasAny($key)
@@ -601,7 +601,7 @@ public function hasAny($key)
601601
$keys = is_array($key) ? $key : func_get_args();
602602

603603
foreach ($keys as $value) {
604-
if ($this->has($value)) {
604+
if (array_key_exists($value, $this->items)) {
605605
return true;
606606
}
607607
}

0 commit comments

Comments
 (0)