Skip to content

Conversation

@fdalcin
Copy link
Contributor

@fdalcin fdalcin commented Feb 4, 2022

Following the improvements made by @nunomaduro on #38538, this pull request updates the type definition of reduce and reduceWithKeys methods to consider the $callback key parameter.

Whenever the reduce callback expects the third parameter static analysis fail because the type is not defined which produces the following error.
image

@fdalcin fdalcin changed the title [9.x] Improves Support\Collection reduce method type definition [9.x] Improves Support\Collection reduce method type definition Feb 4, 2022
@nunomaduro nunomaduro merged commit 0fd262e into laravel:master Feb 4, 2022
@fdalcin fdalcin deleted the generic-reduce-key branch February 4, 2022 20:12
@jamespavett
Copy link

Sorry if this isn't the right place to ask. I noticed this was merged into master, was this not a candidate for inclusion in the latest 9.x release?

@driesvints
Copy link
Member

@fdalcin it seems you indeed sent this to master instead of 9.x. Can you send this in to 9.x as well?

@driesvints driesvints changed the title [9.x] Improves Support\Collection reduce method type definition [10.x] Improves Support\Collection reduce method type definition Feb 28, 2022
@fdalcin
Copy link
Contributor Author

fdalcin commented Feb 28, 2022

Hi, yes I can make a new PR sending this to 9.x. Thought I've done that, sorry about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants