/** * Emit the response using the PHP SAPI. * * @param \Psr\Http\Message\ResponseInterface $response The response to emit * @param \Zend\Diactoros\Response\EmitterInterface|null $emitter The emitter to use. * When null, a SAPI Stream Emitter will be used. * @return void */ public function emit(ResponseInterface $response, EmitterInterface $emitter = null) { $stream = $response->getBody(); if (!$emitter) { $emitter = new ResponseEmitter(); } $emitter->emit($response); }