TEMP : try to return an array
continuous-integration/drone/push Build is passing Details

master
dorian.hodin 2 years ago
parent 9d02ee212c
commit 8f57f8f765

@ -27,14 +27,21 @@ try{
try {
$app->get('/', function (Request $request, Response $response) {
$parameters = $request->getQueryParams();
$method = $parameters['method'];
if (empty($parameters['method'])){
throw new TypeError("No method specified");
}else{
$method = $parameters['method'];
}
unset($parameters['method']);
$listGateway = array("\\Gateway\\GatewayForm", "\\Gateway\\GatewayKeyword", "\\Gateway\\GatewayQuestion");
foreach ($listGateway as $gateway) // Pour chaque Gateway
{
if (method_exists($gateway, $method)) {
//$response->getBody()->write(print_r((new $gateway)->$method($parameters))); // Si oui, on appelle cette fonction
$response->getBody()->write(print_r(array('response' => "Rien", 'test' => "Test Ici")));
$temp = array('response' => "Rien", 'test' => "Test Ici");
foreach ($temp as $key => $value) {
$response->getBody()->write($key,$value);
}
}
}
//return $response;

Loading…
Cancel
Save