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

[10.x] Add Arr::mapSpread helper #50465

Closed
wants to merge 6 commits into from
Closed

[10.x] Add Arr::mapSpread helper #50465

wants to merge 6 commits into from

Conversation

bilfeldt
Copy link
Contributor

@bilfeldt bilfeldt commented Mar 12, 2024

This PR simply adds an already well-known Collection function $collection->mapSpread() to the Array helper:

Arr::mapSpread($data, fn ($first, $second) => $first.$second)

The underlaying logic is completely the same as the already provided Collection function, the point of this PR is to allow for this often used array manipulation without the overhead of creating a Collection instance first.

@bilfeldt bilfeldt marked this pull request as draft March 12, 2024 10:38
@bilfeldt bilfeldt marked this pull request as ready for review March 12, 2024 10:48
@driesvints driesvints changed the title Add Arr::mapSpread helper [10.x] Add Arr::mapSpread helper Mar 12, 2024
@driesvints
Copy link
Member

Please send this to 11.x instead, thanks.

@driesvints driesvints closed this Mar 12, 2024
@bilfeldt
Copy link
Contributor Author

done @driesvints #50474

@bilfeldt bilfeldt deleted the arr-helper-map-spread branch March 12, 2024 19:50
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.

2 participants