Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Added generic typing to EnumeratesValues::flatMap method. #44772

Merged
merged 1 commit into from Dec 2, 2022

Conversation

mad-briller
Copy link
Contributor

@mad-briller mad-briller commented Oct 28, 2022

Improves the generic typing of EnumeratesValues by providing them for the flatMap() method.

Using flatMap right now causes all type information to be lost, and explicitly states there will only be integer keys, when collapse() can produce both string and int keys thanks to it's use of array_merge().

ref: nunomaduro/larastan#1427

@nunomaduro nunomaduro marked this pull request as draft Oct 28, 2022
@mad-briller mad-briller force-pushed the flat-map-generics branch 2 times, most recently from a7745ab to 43860cb Compare Oct 28, 2022
@mad-briller mad-briller marked this pull request as ready for review Oct 28, 2022
@canvural
Copy link
Contributor

canvural commented Oct 28, 2022

Enumerable interface needs to be changed also.

@driesvints driesvints requested a review from nunomaduro Oct 28, 2022
@taylorotwell taylorotwell marked this pull request as draft Oct 28, 2022
@mad-briller mad-briller changed the title Added generic typing to EnumeratesValues::flatMap method. [9.x] Added generic typing to EnumeratesValues::flatMap method. Nov 1, 2022
@mad-briller mad-briller marked this pull request as ready for review Nov 1, 2022
@taylorotwell taylorotwell marked this pull request as draft Nov 1, 2022
@taylorotwell
Copy link
Member

taylorotwell commented Nov 1, 2022

@nunomaduro can you take a look at this?

@nunomaduro nunomaduro marked this pull request as ready for review Dec 2, 2022
@nunomaduro nunomaduro merged commit 37bbb8c into laravel:9.x Dec 2, 2022
20 checks passed
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.

None yet

5 participants