Skip to content

Commit

Permalink
Merge pull request #323 from greg0ire/fix-optional-arg
Browse files Browse the repository at this point in the history
Mark closure arguments as always-provided
  • Loading branch information
greg0ire authored Aug 27, 2022
2 parents c2a8c5f + 4e5e58f commit 3fe7733
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Doctrine/Common/Collections/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function next();
* Tests for the existence of an element that satisfies the given predicate.
*
* @param Closure $p The predicate.
* @psalm-param Closure(TKey=, T=):bool $p
* @psalm-param Closure(TKey, T):bool $p
*
* @return bool TRUE if the predicate is TRUE for at least one element, FALSE otherwise.
*/
Expand All @@ -202,7 +202,7 @@ public function exists(Closure $p);
* The order of the elements is preserved.
*
* @param Closure $p The predicate used for filtering.
* @psalm-param Closure(T=):bool $p
* @psalm-param Closure(T):bool $p
*
* @return Collection<mixed> A collection with the results of the filter operation.
* @psalm-return Collection<TKey, T>
Expand All @@ -213,7 +213,7 @@ public function filter(Closure $p);
* Tests whether the given predicate p holds for all elements of this collection.
*
* @param Closure $p The predicate.
* @psalm-param Closure(TKey=, T=):bool $p
* @psalm-param Closure(TKey, T):bool $p
*
* @return bool TRUE, if the predicate yields TRUE for all elements, FALSE otherwise.
*/
Expand All @@ -223,7 +223,7 @@ public function forAll(Closure $p);
* Applies the given function to each element in the collection and returns
* a new collection with the elements returned by the function.
*
* @psalm-param Closure(T=):U $func
* @psalm-param Closure(T):U $func
*
* @return Collection<mixed>
* @psalm-return Collection<TKey, U>
Expand All @@ -237,7 +237,7 @@ public function map(Closure $func);
* Keys are preserved in the resulting collections.
*
* @param Closure $p The predicate on which to partition.
* @psalm-param Closure(TKey=, T=):bool $p
* @psalm-param Closure(TKey, T):bool $p
*
* @return Collection<mixed>[] An array with two elements. The first element contains the collection
* of elements where the predicate returned TRUE, the second element
Expand Down

0 comments on commit 3fe7733

Please sign in to comment.