Example #1
0
 /**
  * Sends a response to the client.
  *
  * Sends only the status code if the response is marked as an error.
  *
  * @param   Response  $response
  */
 public function sendResponse(Response $response)
 {
     \http_response_code($response->getResponseCode());
     if ($response->isErrorResponse()) {
         return;
     }
     $output = fopen($this->outputStream, 'w');
     fwrite($output, $response);
     fclose($output);
 }