Last active
November 14, 2016 03:51
-
-
Save dusterio/6191329e31e0c89a877a12957cb6bab3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class GatewayController extends Controller | |
{ | |
/** | |
* @param Request $request | |
* @param RestClient $client | |
* @return Response | |
*/ | |
public function get(Request $request, RestClient $client) | |
{ | |
$parametersJar = $request->getRouteParams(); | |
$output = $this->actions->reduce(function($carry, $batch) use (&$parametersJar, $client) { | |
$responses = $client->asyncRequest($batch, $parametersJar); | |
$parametersJar = array_merge($parametersJar, $responses->exportParameters()); | |
return array_merge($carry, $responses->getResponses()->toArray()); | |
}, []); | |
return $this->presenter->format($this->rearrangeKeys($output), 200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment