From 9186239477a0d826e515cfc3adf50c1bcd17ff90 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Wed, 17 Apr 2024 13:22:52 +0200 Subject: [PATCH] Repeat closure type --- src/ArrayCollection.php | 2 ++ src/Collection.php | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ArrayCollection.php b/src/ArrayCollection.php index 43b57541..2e7d0e3b 100644 --- a/src/ArrayCollection.php +++ b/src/ArrayCollection.php @@ -371,6 +371,8 @@ public function reduce(Closure $func, $initial = null) /** * {@inheritDoc} * + * @psalm-param Closure(T, TKey):bool $p + * * @return static * @psalm-return static */ diff --git a/src/Collection.php b/src/Collection.php index 5a763cea..c3c62aa5 100644 --- a/src/Collection.php +++ b/src/Collection.php @@ -96,6 +96,8 @@ public function map(Closure $func); /** * {@inheritDoc} * + * @psalm-param Closure(T, TKey):bool $p + * * @return Collection A collection with the results of the filter operation. * @psalm-return Collection */ @@ -103,7 +105,9 @@ public function filter(Closure $p); /** * {@inheritDoc} - + * + * @psalm-param Closure(TKey, T):bool $p + * * @return Collection[] An array with two elements. The first element contains the collection * of elements where the predicate returned TRUE, the second element * contains the collection of elements where the predicate returned FALSE.