Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/laravel/prefer-collection-is-empty

In the code-quality set. Unsafe fix: it can change behaviour. Runs when laravel is installed. Planned: not in Pun yet. Enabling it is a config error.

What it does

Convert collection count() comparisons against 0 or 1 to isEmpty() or isNotEmpty()

Replaces

More lint/laravel rules · Edit this page

Last updated on

Was this page helpful?