1 | <?php |
||
11 | class ServerRequest extends Response implements RequestInterface |
||
|
|||
12 | { |
||
13 | protected $_cookies = []; |
||
14 | protected $_serverParams = []; |
||
15 | |||
16 | // protocol ver |
||
17 | // headers |
||
18 | // body |
||
19 | |||
20 | |||
21 | public function __construct($cookies = null, $serverParams = null) { |
||
29 | |||
30 | /** |
||
31 | * Retrieve server parameters. |
||
32 | * |
||
33 | * Retrieves data related to the incoming request environment, |
||
34 | * typically derived from PHP's $_SERVER superglobal. The data IS NOT |
||
35 | * REQUIRED to originate from $_SERVER. |
||
36 | * |
||
37 | * @return array |
||
38 | */ |
||
39 | public function getServerParams() { |
||
46 | |||
47 | |||
48 | /** |
||
49 | * Retrieve cookies. |
||
50 | * |
||
51 | * Retrieves cookies sent by the client to the server. |
||
52 | * |
||
53 | * The data MUST be compatible with the structure of the $_COOKIE |
||
54 | * superglobal. |
||
55 | * |
||
56 | * @return array |
||
57 | */ |
||
58 | public function getCookieParams() |
||
62 | |||
63 | public function withCookieParams(array $cookies) |
||
70 | |||
71 | public function setCookies(array $cookies) |
||
77 | |||
78 | public function setCookie($name, $value) |
||
82 | |||
83 | /** |
||
84 | * Retrieve query string arguments. |
||
85 | * |
||
86 | * Retrieves the deserialized query string arguments, if any. |
||
87 | * |
||
88 | * Note: the query params might not be in sync with the URI or server |
||
89 | * params. If you need to ensure you are only getting the original |
||
90 | * values, you may need to parse the query string from `getUri()->getQuery()` |
||
91 | * or from the `QUERY_STRING` server param. |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | public function getQueryParams() |
||
99 | } |
||
100 |