Skip to content

Commit

Permalink
Repeat closure type
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Apr 17, 2024
1 parent 9b9c38a commit 9186239
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ArrayCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,8 @@ public function reduce(Closure $func, $initial = null)
/**
* {@inheritDoc}
*
* @psalm-param Closure(T, TKey):bool $p
*
* @return static
* @psalm-return static<TKey,T>
*/
Expand Down
6 changes: 5 additions & 1 deletion src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,18 @@ public function map(Closure $func);
/**
* {@inheritDoc}
*
* @psalm-param Closure(T, TKey):bool $p
*
* @return Collection<mixed> A collection with the results of the filter operation.
* @psalm-return Collection<TKey, T>
*/
public function filter(Closure $p);

/**
* {@inheritDoc}
*
* @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
* contains the collection of elements where the predicate returned FALSE.
Expand Down

0 comments on commit 9186239

Please sign in to comment.