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 |
||
28 | |||
29 | /** |
||
30 | * Get request parameters. |
||
31 | * |
||
32 | * @return array|null |
||
33 | */ |
||
34 | public function getParameters(): ?array |
||
38 | |||
39 | /** |
||
40 | * Get single parameter. |
||
41 | * |
||
42 | * @param string $key |
||
43 | * @param mixed $default |
||
44 | * |
||
45 | * @return mixed |
||
46 | */ |
||
47 | public function getParameter(string $key, $default = null) |
||
51 | |||
52 | /** |
||
53 | * Determine if request has one or more parameters. |
||
54 | * |
||
55 | * @param array|string $keys |
||
56 | * |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function hasParameters($keys): bool |
||
63 | |||
64 | /** |
||
65 | * Get request headers. |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | public function getHeaders(): array |
||
73 | |||
74 | /** |
||
75 | * Get single request header. |
||
76 | * |
||
77 | * @param string $key |
||
78 | * @param mixed $default |
||
79 | * |
||
80 | * @return mixed |
||
81 | */ |
||
82 | public function getHeader(string $key, $default = null) |
||
86 | } |
||
87 |