| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | final class Response |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var mixed |
||
| 12 | */ |
||
| 13 | protected $data; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | */ |
||
| 18 | protected $status; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Response constructor. |
||
| 22 | * |
||
| 23 | * @param $data |
||
| 24 | * @param int $status |
||
| 25 | */ |
||
| 26 | 5 | public function __construct($data, int $status) |
|
| 30 | 5 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * @param iterable $headers |
||
| 34 | * |
||
| 35 | * @return HttpResponse |
||
| 36 | */ |
||
| 37 | 1 | public function toHttpResponse() : HttpResponse |
|
| 38 | { |
||
| 39 | 1 | return new HttpResponse( |
|
| 40 | 1 | $this->data, |
|
| 41 | 1 | $this->status |
|
| 42 | ); |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @return mixed |
||
| 47 | */ |
||
| 48 | 2 | public function getData() |
|
| 49 | { |
||
| 50 | 2 | return $this->data; |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return int |
||
| 55 | */ |
||
| 56 | 2 | public function getStatus(): int |
|
| 59 | } |
||
| 60 | |||
| 61 | } |