-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
rectorphp/rector-src
#7154Labels
Description
Bug Report
| Subject | Details |
|---|---|
| Rector version | 2.0.10 |
The SimplifyEmptyArrayCheck rule seems to be matching too basic a pattern and just putting whatever contents from empty() before the ===. In this example, the is_array() check ensures that the array_filter() isn't called with a non-array value, because the conditions of the if statement are executed left to right, so by replacing the whole thing with a === any non-array values introduce TypeErrors.
Minimal PHP Code Causing Issue
https://getrector.com/demo/6cd7324e-783f-4e56-ac85-bb7cdfce4bfa
Expected Behaviour
In this case, I think I'd expect it to be skipped?
Reactions are currently unavailable