Open bkdotcom opened 9 months ago
I found these snippets:
The callback for array_walk
doesn't have more specific types in psalm's callmap.
Ideally the annotation would be callable(&value-of<T>, key-of<T>, mixed=)
or even better to create a separate \2 annotation where the optional 3rd arg is only included when arg is set and otherwise not.
For \1 with object would be like callable(&value-of<properties-of<T>>, key-of<properties-of<T>>, mixed=)
Same for array_walk_recursive
I guess.
Related... psalm doesn't understand the assertions happening within array_walk
here, after array_walk, we should know that the array is array<array-key, int|string> vs array<array-key, mixed>
I found these snippets:
https://psalm.dev/r/93b224455b
it seems to me that Psalm should be able to infer that $index is of type
array-key
and not mixed?