Prevent exception of arrays

This commit is contained in:
Dennis Eichhorn 2018-07-28 20:46:28 +02:00
parent 244e2e8d86
commit ee018f124f

View File

@ -131,6 +131,8 @@ final class Response extends ResponseAbstract implements RenderableInterface
$render .= $response->serialize();
} elseif (\is_string($response) || \is_numeric($response)) {
$render .= $response;
} elseif (\is_array($response)) {
$render .= \json_encode($response);
} else {
throw new \Exception('Wrong response type');
}