Hi. I'm writing a plugin for my protobuf serialization library. I decided to do a tight integration with static analysis tools and let users specify types directly in the phpdoc: @param int32 $id. Now I was able to teach psalm through the plugin to understand such types, but not for an array. If the array key contains a type known to psalm, for example array<string, int32>, there is no problem, but not when the key is unknown, for example array<int32, string>, - in this case psalm thinks that there is array<array-key, mixed>. What can be done in this case?
Hey @kafkiansky, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.
Hi. I'm writing a plugin for my protobuf serialization library. I decided to do a tight integration with static analysis tools and let users specify types directly in the phpdoc:
@param int32 $id
. Now I was able to teach psalm through the plugin to understand such types, but not for an array. If the array key contains a type known to psalm, for examplearray<string, int32>
, there is no problem, but not when the key is unknown, for examplearray<int32, string>
, - in this case psalm thinks that there isarray<array-key, mixed>
. What can be done in this case?