private function sendHttpFoundationResponse(int $requestId, HttpFoundationResponse $response): void
    {
        $statusCode = $response->getStatusCode();

        $headerData  = "Status: {$statusCode}\r\n";
        $headerData .= $response->headers."\r\n";

        $stream = fopen('php://memory', 'r+');
        fwrite($stream, $response->getContent());

        $this->writeResponse($requestId, $headerData, $stream);
    }
private function sendHttpFoundationResponse(int $requestId, HttpFoundationResponse $response): void
    {
        $statusCode = $response->getStatusCode();

        $headerData  = "Status: {$statusCode}\r\n";
        $headerData .= $response->headers."\r\n";

        $stream = fopen('php://memory', 'r+');
        fwrite($stream, $response->getContent());

        $this->writeResponse($requestId, $headerData, $stream);
    }
private function sendHttpFoundationResponse ( int $ requestId , HttpFoundationResponse $ response ) : void { $ statusCode = $ response -> getStatusCode ( ) ; $ headerData = "Status: {$statusCode}\r\n" ; $ headerData .= $ response -> headers . "\r\n" ; $ stream = fopen ( 'php://memory' , 'r+' ) ; fwrite ( $ stream , $ response -> getContent ( ) ) ; $ this -> writeResponse ( $ requestId , $ headerData , $ stream ) ; }
Send a HttpFoundation response to the client.

@param int                    $requestId The request id to respond to
@param HttpFoundationResponse $response  The HTTP foundation response message
Send a HttpFoundation response to the client .