This file contains 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