Inheritance: implements Zend\Diactoros\Response\EmitterInterface, use trait SapiEmitterTrait
Beispiel #1
0
 public function emit(ResponseInterface $response, EmitterInterface $emitter = null)
 {
     if (!$emitter) {
         $emitter = new SapiStreamEmitter();
     }
     $emitter->emit($response);
 }
Beispiel #2
0
 /**
  * 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 && !$stream->isSeekable()) {
         $emitter = new SapiEmitter();
     }
     if (!$emitter) {
         $emitter = new SapiStreamEmitter();
     }
     $emitter->emit($response);
 }