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
Plugin should add capability to infer reduced type from Collection::filter based on assertions in a callback, similarly as Psalm currently does for array_filter. Here is what should be supported: https://psalm.dev/r/1b5cbdc9c0
Can you provide the example of desired behavior using array_filter?
This: https://psalm.dev/r/e24db6727c results in pretty much the same issues emitted as in your example with Collection::filter()
Hmm yeah so $stdClass !== null needs to be used explicitly, that's what I did after I refactored it into array_filter but assumed Psalm will know that (bool) object will result in non-nullable value. Anyways (bool) is different issue, here we go for array_filter inference demonstration https://psalm.dev/r/16fbce64d4
Plugin should add capability to infer reduced type from
Collection::filter
based on assertions in a callback, similarly as Psalm currently does forarray_filter
. Here is what should be supported: https://psalm.dev/r/1b5cbdc9c0Backstory: From conversation with @muglug:
The text was updated successfully, but these errors were encountered: