-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#938Labels
Description
Feature request
array_filter is already understanding complex closures or arrow functions via ArrayFilterFunctionReturnTypeReturnTypeExtension but interestingly it can't deal with more simple string-callables like is_string. Would be great if it could understand that as well.
It looks like TypeSpecifyingFunctionsDynamicReturnTypeExtension is dealing with the narrowing-down of those simple type specifying functions and therefore maybe somehow related.
See https://phpstan.org/r/33b86b4b-41ae-4953-b062-80d11a74ffb2
Did PHPStan help you today? Did it make you happy in any way?
Yes for sure. And I was impressed that it can narrow down arrays to lists via $a === array_values($a) :)