Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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