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] Fix Collection::implode() string argument #41468

Conversation

derekmd
Copy link
Contributor

@derekmd derekmd commented Mar 14, 2022

Fixes #41466 introduced by #41405

collect(['foo', 'bar'])->implode('_') should be 'foo_bar' but it instead attempts to call translation helper _().

It needs the same fix as #41424

For a callable arg, don't support global helpers. Only allow a Closure, invokable class, or [$object, 'method'] array pair.

collect(['foo', 'bar'])->implode('_') should be 'foo-bar' but it
instead attempts to call translator helper _().

For callable only support Closure, an invokable class, or a
[class, 'method'] array pair.
@seriquynh
Copy link
Contributor

Is this a typo mistake? You mean collect(['foo', 'bar'])->implode('_') should be 'foo_bar', don't you?
WXWorkCapture_16472344322968

@taylorotwell taylorotwell merged commit 9e7d31d into laravel:9.x Mar 14, 2022
@derekmd derekmd deleted the collection-implode-callable-skips-global-helpers branch March 14, 2022 19:48
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.

[9.x] calling Collection::implode('_') throws error
4 participants