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.5] Added isNotEmpty to complement isEmpty #19944

Merged
merged 1 commit into from
Jul 7, 2017
Merged

[5.5] Added isNotEmpty to complement isEmpty #19944

merged 1 commit into from
Jul 7, 2017

Conversation

timacdonald
Copy link
Member

@timacdonald timacdonald commented Jul 7, 2017

I've come to love the isEmpty and isNotEmpty methods on the collection class.

It's always great when you can guess what methods are available in Laravel - and they are there.

Now that I've grown accustomed to the isEmpty method - I assume everywhere I can use that, I can use the complement isNotEmpty method. Unfortunately this is not standard across the code base. For example on the MessageBag class there is an isEmpty and an any method. This PR introduces an isNotEmpty method where ever the isEmpty method is present.

I'm not 100% sure if this should change the contracts, but as 5.5 is nearly here, I thought I'd add it to the contracts and the classes anyway and pull it into 5.5.

I haven't added any tests, would rather know if this is wanted / appropriate first.

@taylorotwell taylorotwell merged commit f5932d7 into laravel:master Jul 7, 2017
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