How to handle support for mapping to stdClass
djmattyg007 opened this issue · 4 comments
PHPStan has configuration for something it calls "object crates". These are classes that are like stdClass, that just accept whatever you read and write to them by way of __get() and __set().
I'd lile to suggest that the best way to support mapping to stdClass would be a generic system such as this, where you configure a destination class as an object crate, and everything is just written as-is. This makes it easy to extend when integrating it into frameworks and other dynamic code.
I'll definitely look into this, and how it's implemented in PHPStan. Thanks for the suggestion!
Any progress on adding this feature?
I haven't started on this yet, as it looks it might take some time to do it right. I'll look into it come next week, since I'm a bit busy this week (holidays).
This is available as of release 1.1.0. I'm closing this, but feel free to reopen / create a new isue if you encounter problems :)