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

[5.7] fix bug when using 'some' alias for the 'contains' method #26696

Merged
merged 2 commits into from Dec 2, 2018

Conversation

Projects
None yet
3 participants
@chapeupreto
Contributor

chapeupreto commented Dec 1, 2018

This PR aims to solve issue #26695

@chapeupreto chapeupreto changed the title from fix bug when using 'some' alias for the 'contains' method to [5.7] fix bug when using 'some' alias for the 'contains' method Dec 1, 2018

@staudenmeir

This comment has been minimized.

Contributor

staudenmeir commented Dec 1, 2018

array_filter() breaks values like 0 or null:

$collection = collect([0]);
$collection->contains(0); // exception

I suggest a different solution: We replace return $this->contains($key, $operator, $value); with return $this->contains(...func_get_args());.

@chapeupreto

This comment has been minimized.

Contributor

chapeupreto commented Dec 1, 2018

Thanks for pointing that out.

I followed your suggestion and everything is working pretty good now.

Thanks!

@taylorotwell taylorotwell merged commit 903305b into laravel:5.7 Dec 2, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment