lint/complexity/prefer-empty-array-compare
In the code-quality set. Safe fix.
What it does
Compare with [] instead of empty()/is_array() on arrays.
Configuration
[lint.rules]
"complexity/prefer-empty-array-compare" = "error"
To skip it in some files or lines, add an override or an ignore comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
checks |
list |
empty, is-array |
["empty", "is-array"] |
None (Pun’s own) |
Replaces
SimplifyEmptyArrayCheck(rector)SimplifyEmptyCheckOnEmptyArray(rector)
Merged rules
These old IDs are now this rule. A config that still names one stops with an error. See merged rules.
lint/complexity/prefer-empty-array-identical