Open hopeseekr opened 5 years ago
A year+ later, I still can't figure out how to actually architect this.
What I've been doing is this:
$response = $api->post('/uri', ['post' => 'data']);
return new Read\AccountDTO((array) $response);
SimpleDTO's validation takes care of whether or not the API call succeeded or not.
I don't even know if this is so necessary anymore.
It would be awesome to integrate phpexpertsinc/SimpleDTO with this project.
Minimally, we need the ability to specify what SimpleDTO class to return for any particular HTTP call.
Ideally, we would return every response as a blank + permissive SimpleDTO.