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.