I wanted to do that, however it's not easy to do with dependency injection because we have to specially setup the symfony request (there is a function for it at the end of functions.php). So I'm not sure if there is a way it's possible to turn it into an object or not.

I'm looking into this now though, if it's possible I'll try it.