| 1 | <?php |
||
| 10 | class Request |
||
| 11 | { |
||
| 12 | private $parameters; |
||
| 13 | private $headers; |
||
| 14 | |||
| 15 | 1 | public function __construct(array $parameters, array $headers) |
|
| 20 | |||
| 21 | public static function fromMessage(MessageInterface $message): Request |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Get request parameters. |
||
| 39 | * |
||
| 40 | * @return array|null |
||
| 41 | */ |
||
| 42 | public function getParameters(): ?array |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Get single parameter. |
||
| 49 | * |
||
| 50 | * @param string $key |
||
| 51 | * @param mixed $default |
||
| 52 | * |
||
| 53 | * @return mixed |
||
| 54 | */ |
||
| 55 | public function getParameter(string $key, $default = null) |
||
| 59 | |||
| 60 | /** |
||
| 61 | * Determine if request has one or more parameters. |
||
| 62 | * |
||
| 63 | * @param array|string $keys |
||
| 64 | * |
||
| 65 | * @return bool |
||
| 66 | */ |
||
| 67 | public function hasParameters($keys): bool |
||
| 71 | |||
| 72 | /** |
||
| 73 | * Get request headers. |
||
| 74 | * |
||
| 75 | * @return array |
||
| 76 | */ |
||
| 77 | public function getHeaders(): array |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Get single request header. |
||
| 84 | * |
||
| 85 | * @param string $key |
||
| 86 | * @param mixed $default |
||
| 87 | * |
||
| 88 | * @return mixed |
||
| 89 | */ |
||
| 90 | public function getHeader(string $key, $default = null) |
||
| 94 | } |
||
| 95 |