-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Description
Feature request
For array_filter with no callback, PHPStan could report useless calls if the type for the array does not contain any empty values (null/==false). This could indicate an incorrect type for the array or another oversight.
For example:
array_filter([0,1,2]);
array_filter([1,2]); // report
array_filter(['', 'hello']);
array_filter([false, true]);
array_filter([new \stdClass()]); // report
/** \stdClass[] $arr */
array_filter($arr); // report
I could work on this if you're interested in the feature.