protected static function mapResponse(ReactResponse $reactResponse, SymfonyResponse $symfonyResponse)
{
$headers = $symfonyResponse->headers->all();
$reactResponse->writeHead($symfonyResponse->getStatusCode(), $headers);
// @TODO convert StreamedResponse in an async manner
if ($symfonyResponse instanceof SymfonyStreamedResponse) {
ob_start();
$symfonyResponse->sendContent();
$content = ob_get_contents();
ob_end_clean();
} else {
$content = $symfonyResponse->getContent();
}
$reactResponse->end($content);
}