psalm icon indicating copy to clipboard operation
psalm copied to clipboard

Support extended types `stdClass<type>` and `stdClass{foo:type}`

Open GromNaN opened this issue 7 months ago • 2 comments

stdClass objects doesn't define their property types. Since they are hash-map like arrays, I would like to define their type like an array.

Using type template

stdClass<string|int>

Using type map

stdClass{foo:string,optional?:int}

https://psalm.dev/r/2fd2b967f8

GromNaN avatar Jan 22 '24 17:01 GromNaN