Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
40.00% |
2 / 5 |
CRAP | |
50.00% |
4 / 8 |
| Response | |
0.00% |
0 / 1 |
|
40.00% |
2 / 5 |
8.12 | |
50.00% |
4 / 8 |
| __construct | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| setBody | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
| getBody | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| setHeader | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 2 |
|||
| getHeaders | |
0.00% |
0 / 1 |
2.00 | |
0.00% |
0 / 1 |
|||
| <?php | |
| namespace Luxian\Http; | |
| use ArrayObject; | |
| use Iterator; | |
| use Luxian\Type\HttpHeader; | |
| class Response | |
| { | |
| private $body = ''; | |
| private $headers; | |
| public function __construct() | |
| { | |
| $this->headers = new ArrayObject([]); | |
| } | |
| public function setBody(string $body): void | |
| { | |
| $this->body = $body; | |
| } | |
| public function getBody(): string | |
| { | |
| return $this->body; | |
| } | |
| public function setHeader(HttpHeader $header): void | |
| { | |
| $this->headers[$header->getName()] = $header; | |
| } | |
| public function getHeaders(): Iterator | |
| { | |
| return $this->headers->getIterator(); | |
| } | |
| } |