You are here

private function SapiEmitter::emitStatusLine in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php \Zend\Diactoros\Response\SapiEmitter::emitStatusLine()

Emit the status line.

Emits the status line using the protocol version and status code from the response; if a reason phrase is availble, it, too, is emitted.

Parameters

ResponseInterface $response:

1 call to SapiEmitter::emitStatusLine()
SapiEmitter::emit in vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php
Emits a response for a PHP SAPI environment.

File

vendor/zendframework/zend-diactoros/src/Response/SapiEmitter.php, line 45

Class

SapiEmitter

Namespace

Zend\Diactoros\Response

Code

private function emitStatusLine(ResponseInterface $response) {
  $reasonPhrase = $response
    ->getReasonPhrase();
  header(sprintf('HTTP/%s %d%s', $response
    ->getProtocolVersion(), $response
    ->getStatusCode(), $reasonPhrase ? ' ' . $reasonPhrase : ''));
}