| Total Complexity | 6 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class ServerResponse extends Response |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Construct a ServerResponse object with the given status code, reason phrase, version, headers & body. |
||
| 23 | * |
||
| 24 | * @param int $statusCode |
||
| 25 | * @param string $reasonPhrase = '' |
||
| 26 | * @param string $version = self::DEFAULT_VERSION |
||
| 27 | * @param array $headers = [] |
||
| 28 | * @param StreamInterface|null $body = null |
||
| 29 | */ |
||
| 30 | 3 | public function __construct($statusCode, $reasonPhrase = '', $version = self::DEFAULT_VERSION, array $headers = [], StreamInterface $body = null) |
|
| 31 | { |
||
| 32 | 3 | if ($body === null) { |
|
| 33 | 3 | $body = new Stream(fopen('php://output', 'w')); |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | parent::__construct($statusCode, $reasonPhrase, $version, $headers, $body); |
|
| 37 | 3 | } |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Send the server response. |
||
| 41 | * |
||
| 42 | * @return null |
||
| 43 | */ |
||
| 44 | 1 | public function send() |
|
| 55 | 1 | } |
|
| 56 | } |
||
| 57 |