| 1 | <?php |
||
| 10 | class Request |
||
| 11 | { |
||
| 12 | private $parameters; |
||
| 13 | private $headers; |
||
| 14 | |||
| 15 | 3 | public function __construct(array $parameters, array $headers) |
|
| 20 | |||
| 21 | 2 | public static function fromMessage(MessageInterface $message): Request |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Get request parameters. |
||
| 36 | * |
||
| 37 | * @return array |
||
| 38 | */ |
||
| 39 | 1 | public function getParameters(): array |
|
| 43 | |||
| 44 | /** |
||
| 45 | * Get single parameter. |
||
| 46 | * |
||
| 47 | * @param string $key |
||
| 48 | * @param mixed $default |
||
| 49 | * |
||
| 50 | * @return mixed |
||
| 51 | */ |
||
| 52 | 1 | public function getParameter(string $key, $default = null) |
|
| 56 | |||
| 57 | /** |
||
| 58 | * Determine if request has one or more parameters. |
||
| 59 | * |
||
| 60 | * @param array|string $keys |
||
| 61 | * |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | 1 | public function hasParameters($keys): bool |
|
| 68 | |||
| 69 | /** |
||
| 70 | * Get request headers. |
||
| 71 | * |
||
| 72 | * @return array |
||
| 73 | */ |
||
| 74 | 1 | public function getHeaders(): array |
|
| 78 | |||
| 79 | /** |
||
| 80 | * Get single request header. |
||
| 81 | * |
||
| 82 | * @param string $key |
||
| 83 | * @param mixed $default |
||
| 84 | * |
||
| 85 | * @return mixed |
||
| 86 | */ |
||
| 87 | 1 | public function getHeader(string $key, $default = null) |
|
| 91 | } |
||
| 92 |