You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was surprised to find out that PHPStan does not support checking if types match in case of native function like array_map/array_filter and similar.
I suppose that's due to the fact that the functionMap.php does not support generics or at least the generic types are not specified.
I would really appreciate if it could be done at least for some of the most used methods as it gives a false sense of security now with runtime error :)
Do you think it is possible to add support for something like this in the future?
Thanks a lot!
The text was updated successfully, but these errors were encountered:
olsavmic
changed the title
Standard array function do not check if array and callback type matches - support generics in functionMap
Standard PHP function are not checked if array and callback type matches - support generics in functionMap
Apr 28, 2021
Support for stub files overriding internal functions could be added, but array_map and array_filter have a lot of special handling in the core already, and I worry that generics would clash with that so there needs to be special care applied during the implementation.
Feature request
Hi,
I was surprised to find out that PHPStan does not support checking if types match in case of native function like array_map/array_filter and similar.
https://phpstan.org/r/d7ff2afa-6d0a-436f-9011-dee78f6d994e#
I suppose that's due to the fact that the
functionMap.php
does not support generics or at least the generic types are not specified.I would really appreciate if it could be done at least for some of the most used methods as it gives a false sense of security now with runtime error :)
Do you think it is possible to add support for something like this in the future?
Thanks a lot!
The text was updated successfully, but these errors were encountered: