5use Psr\Http\Message\ResponseInterface;
34 http_response_code(
$response->getStatusCode());
37 foreach (
$response->getHeaders() as $key => $header) {
38 header(
"$key: " .
$response->getHeaderLine($key));
45 $resource =
$response->getBody()->detach();
49 if (is_resource($resource)) {
52 $sendStatus = fpassthru($resource);
59 if ($sendStatus ===
false) {
An exception for terminatinating execution or to throw for unit testing.
Class DefaultResponseSenderStrategy.
sendResponse(ResponseInterface $response)
Sends the rendered response to the client.
Interface ResponseSenderStrategy.