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

[5.4] add default param to collection's when() method #17941

Merged
merged 4 commits into from Feb 15, 2017

Conversation

tomschlick
Copy link
Contributor

This brings the changes made in #17917 up to date with my original changes to the eloquent query builder made in #15428

{
if ($value) {
return $callback($this);
} elseif ($default) {
return $default($this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this elseif can just be an if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gonna leave that as is. Thats what we currently use for the eloquent QB and it works just fine for now

@@ -315,10 +315,12 @@ public function filter(callable $callback = null)
* @param callable $callback
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docblock needs updating as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@taylorotwell taylorotwell merged commit 2728ea7 into laravel:5.4 Feb 15, 2017
@tomschlick tomschlick deleted the patch-3 branch February 15, 2017 21:25
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

3 participants