| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | 1 | public function createResponse(int $code = 200, string $reasonPhrase = ''): ResponseInterface |
|
| 33 | { |
||
| 34 | 1 | extract(SuperGlobal::extract()); |
|
| 35 | |||
| 36 | 1 | $protocol = $server['SERVER_PROTOCOL'] ?? '1.1'; |
|
| 37 | 1 | $protocol = str_replace('HTTP/', '', $protocol); |
|
| 38 | |||
| 39 | 1 | $streamFactory = new streamFactory(); |
|
| 40 | |||
| 41 | 1 | $body = $streamFactory->createStream(); |
|
| 42 | |||
| 43 | 1 | return new Response( |
|
| 44 | 1 | $code, |
|
| 45 | 1 | $header, // from extract. |
|
| 46 | 1 | $body, |
|
| 47 | 1 | $protocol, |
|
| 48 | 1 | $reasonPhrase |
|
| 49 | 1 | ); |
|
| 68 |