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] Remove useless reduceWithKeys method #40566

Merged

Conversation

JosephSilber
Copy link
Member

@JosephSilber JosephSilber commented Jan 23, 2022

The original introduction of reduceWithKeys was kind of not ideal for two reasons: the name is inconsistent with the other *WithKeys method, and it really should've never been a separate method - reduce itself could handle keys too.

...and that's what we ultimately did: we added $key support to the regular reduce method.

We decided to keep reduceWithKeys in 8.x, and then remove it completely in 9.x. I think #35901 was trying to do that, but evidently it's still around. So this PR removes it.

@JosephSilber JosephSilber force-pushed the remove-useless-reduce-with-keys branch from df45ac7 to 8ae8e34 Compare January 23, 2022 04:02
@taylorotwell
Copy link
Member

taylorotwell commented Jan 24, 2022

What is the migration path for those using this method already when upgrading from 8.x? Please mark as ready for review when provided.

@taylorotwell taylorotwell marked this pull request as draft January 24, 2022 02:35
@JosephSilber
Copy link
Member Author

Simply switch their uses of reduceWithKeys to reduce, as they both do the exact same thing.

@JosephSilber JosephSilber marked this pull request as ready for review January 24, 2022 03:21
@taylorotwell taylorotwell merged commit 9b4f011 into laravel:9.x Jan 24, 2022
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

2 participants