| 1 | <?php |
||
| 6 | trait HttpAttributesContainer |
||
| 7 | { |
||
| 8 | /** |
||
| 9 | * Status code |
||
| 10 | * |
||
| 11 | * @var int |
||
| 12 | */ |
||
| 13 | protected $statusCode = 200; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Response headers |
||
| 17 | * |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $headers = []; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Set status code |
||
| 24 | * |
||
| 25 | * @param int $code |
||
| 26 | * @return mixed |
||
| 27 | */ |
||
| 28 | public function setStatusCode(int $code) |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Get status code |
||
| 35 | * |
||
| 36 | * @return int |
||
| 37 | */ |
||
| 38 | 3 | public function getStatusCode(): int |
|
| 42 | |||
| 43 | /** |
||
| 44 | * Set header |
||
| 45 | * |
||
| 46 | * @param string $name |
||
| 47 | * @param string $value |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | public function setHeader(string $name, string $value) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Get response headers |
||
| 57 | * |
||
| 58 | * @return array |
||
| 59 | */ |
||
| 60 | 3 | public function getHeaders(): array |
|
| 64 | } |