| 1 | <?php |
||
| 5 | class Request |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Method. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $method; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Path. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $path; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Method. |
||
| 23 | * |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | protected $headers; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Body. |
||
| 30 | * |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | protected $body; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Assign dependencie. |
||
| 37 | * |
||
| 38 | * @param string $method |
||
| 39 | * @param string $path |
||
| 40 | * @param array $headers |
||
| 41 | * @param string $body |
||
| 42 | */ |
||
| 43 | 18 | public function __construct($method, $path, array $headers = [], $body = '') |
|
| 50 | |||
| 51 | /** |
||
| 52 | * Get path. |
||
| 53 | * |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | 6 | public function getPath() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * Get body. |
||
| 63 | * |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | 6 | public function getBody() |
|
| 70 | |||
| 71 | /** |
||
| 72 | * Get headers. |
||
| 73 | * |
||
| 74 | * @return array |
||
| 75 | */ |
||
| 76 | 6 | public function getHeaders() |
|
| 80 | } |
||
| 81 |