Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 507c23c

Browse files
authoredOct 19, 2022
Merge pull request #244 from php-school/phpstan-flatmap
Phpstan flatmap support
2 parents 25d4492 + 34910d4 commit 507c23c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/Utils/ArrayObject.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ public function filter(callable $callback): self
7171
* Run a callable over each item in the array and flatten the results by one level returning a new instance of
7272
* `ArrayObject` with the flattened items.
7373
*
74-
* @param callable $callback
75-
* @return static
74+
* @template TFlatMapReturn of array
75+
*
76+
* @param callable(T): TFlatMapReturn $callback
77+
* @return static<int|string, mixed>
7678
*/
7779
public function flatMap(callable $callback): self
7880
{

0 commit comments

Comments
 (0)
Please sign in to comment.