jsonmapper
jsonmapper copied to clipboard
Support for `array<Type>` (alternative to `Type[]`)
I usually use array<Type> in my projects, but JsonMapper doesn't support that.
It does however support Type[], and for that I am grateful 🙂 .
Would adding support for array<Type> be difficult?
I think this way of declaring contents of an array is reflecting the way PHPStan any other static analysis tools and IDEs offer it, but if that's the feature to be implemented, then it should also allow for the full variant of array<keytype, valuetype> - and it should obviously allow for a bit of spicy mixture of types if this sounds reasonable, i.e. array<int, string|null> or array<string, array<int, Type>> (at least the last option may not be relevant, but union types). See https://phpstan.org/writing-php-code/phpdocs-basics#combining-phpdoc-types-with-native-typehints
I would also like to request support for list<Type> style docblocks.