1 | <?php |
||
5 | class Response |
||
6 | { |
||
7 | /** |
||
8 | * HTTP Status code |
||
9 | * |
||
10 | * @int |
||
11 | */ |
||
12 | protected $status; |
||
13 | |||
14 | /** |
||
15 | * Headers. |
||
16 | * |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $headers; |
||
20 | |||
21 | /** |
||
22 | * Contents. |
||
23 | * |
||
24 | * @var string |
||
25 | */ |
||
26 | protected $body; |
||
27 | |||
28 | /** |
||
29 | * Assign dependencies. |
||
30 | * |
||
31 | * @param int $status |
||
32 | * @param array $headers |
||
33 | * @param string $body |
||
34 | */ |
||
35 | 12 | public function __construct($status = 200, array $headers = [], $body = null) |
|
41 | |||
42 | /** |
||
43 | * Get body. |
||
44 | * |
||
45 | * @return string |
||
46 | */ |
||
47 | 8 | public function getBody() |
|
51 | |||
52 | /** |
||
53 | * Get HTTP status code. |
||
54 | * |
||
55 | * @return string |
||
56 | */ |
||
57 | 2 | public function getStatus() |
|
61 | } |
||
62 |