Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 15 |
|
0.00% |
0 / 15 |
CRAP | |
0.00% |
0 / 1 |
| Response | |
0.00% |
0 / 15 |
|
0.00% |
0 / 15 |
240 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getProtocolVersion | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withProtocolVersion | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getHeaders | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| hasHeader | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getHeader | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getHeaderLine | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withHeader | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withAddedHeader | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withoutHeader | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withBody | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getStatusCode | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| withStatus | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getReasonPhrase | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace pvc\http\psr7; |
| 4 | |
| 5 | use Psr\Http\Message\MessageInterface; |
| 6 | use Psr\Http\Message\ResponseInterface; |
| 7 | use Psr\Http\Message\StreamInterface; |
| 8 | use GuzzleHttp\Psr7\Response as GuzzleResponse; |
| 9 | class Response implements ResponseInterface |
| 10 | { |
| 11 | public function __construct(protected GuzzleResponse $response) {} |
| 12 | public function getProtocolVersion(): string |
| 13 | { |
| 14 | return $this->response->getProtocolVersion(); |
| 15 | } |
| 16 | |
| 17 | public function withProtocolVersion(string $version): MessageInterface |
| 18 | { |
| 19 | return $this->response->withProtocolVersion($version); |
| 20 | } |
| 21 | |
| 22 | public function getHeaders(): array |
| 23 | { |
| 24 | return $this->response->getHeaders(); |
| 25 | } |
| 26 | |
| 27 | public function hasHeader(string $name): bool |
| 28 | { |
| 29 | return $this->response->hasHeader($name); |
| 30 | } |
| 31 | |
| 32 | public function getHeader(string $name): array |
| 33 | { |
| 34 | return $this->response->getHeader($name); |
| 35 | } |
| 36 | |
| 37 | public function getHeaderLine(string $name): string |
| 38 | { |
| 39 | return $this->response->getHeaderLine($name); |
| 40 | } |
| 41 | |
| 42 | public function withHeader(string $name, $value): MessageInterface |
| 43 | { |
| 44 | return $this->response->withHeader($name, $value); |
| 45 | } |
| 46 | |
| 47 | public function withAddedHeader(string $name, $value): MessageInterface |
| 48 | { |
| 49 | return $this->response->withAddedHeader($name, $value); |
| 50 | } |
| 51 | |
| 52 | public function withoutHeader(string $name): MessageInterface |
| 53 | { |
| 54 | return $this->response->withoutHeader($name); |
| 55 | } |
| 56 | |
| 57 | public function getBody(): StreamInterface |
| 58 | { |
| 59 | return $this->response->getBody(); |
| 60 | } |
| 61 | |
| 62 | public function withBody(StreamInterface $body): MessageInterface |
| 63 | { |
| 64 | return $this->response->withBody($body); |
| 65 | } |
| 66 | |
| 67 | public function getStatusCode(): int |
| 68 | { |
| 69 | return $this->response->getStatusCode(); |
| 70 | } |
| 71 | |
| 72 | public function withStatus( |
| 73 | int $code, |
| 74 | string $reasonPhrase = '' |
| 75 | ): ResponseInterface { |
| 76 | return $this->response->withStatus($code, $reasonPhrase); |
| 77 | } |
| 78 | |
| 79 | public function getReasonPhrase(): string |
| 80 | { |
| 81 | return $this->response->getReasonPhrase(); |
| 82 | } |
| 83 | } |