-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
Labels
Milestone
Description
Feature request
I am trying to define generic types for a set of array-wrapping methods, which allow reading/writing a key. Something not so uncommon (think Symfony's ParameterBag and similar).
I tried setting it up like this which works partially (for keys) but the values are completely untyped:
https://phpstan.org/r/85335c46-5a90-4dca-838a-1d033780e443
A suggested solution would be to add a second param to value-of<> to allow retrieving the type of a specific key like value-of<T, K>, which you can see illustrated here although this fails to parse: