-
-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Having a dataMapper type method would be a nice to have. I'm having to work with a janky API which doesn't have consistency in it's results. It also is quiet generic and just returns 'data' without any description of what I'm getting back. Having a 'dataMapper' option to trigger a function/callable to iterate over the results mapping the key->values would be a way to do this. I've been able to wire this up using Guzzle Middleware::mapResponse(). However, I can't find an easy way to inject this sort of behavior based on the service/operation being called. I've got a pile of code working by overriding the ServiceClient->__call() method which seeks out the description->command->config.. which I've added an extra array element 'dataMapper' => 'App\Name\Space' and then dynamically instantiate it in the __call() method. It's an ugly ugly hack at best. Suggestions?