lint/laravel/prefer-collection-is-empty
In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.
What it does
Convert collection count() comparisons against 0 or 1 to isEmpty() or isNotEmpty()
Configuration
[lint.rules]
"laravel/prefer-collection-is-empty" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Replaces
CollectionCountComparisonToIsEmpty(rector-laravel)