1 | <?php |
||
23 | class Request |
||
24 | { |
||
25 | /** |
||
26 | * @var ParameterBag |
||
27 | */ |
||
28 | protected $request; |
||
29 | |||
30 | /** |
||
31 | * @var ParameterBag |
||
32 | */ |
||
33 | protected $query; |
||
34 | |||
35 | /** |
||
36 | * @var ParameterBag |
||
37 | */ |
||
38 | protected $server; |
||
39 | |||
40 | /** |
||
41 | * @var HeaderBag |
||
42 | */ |
||
43 | protected $headers; |
||
44 | |||
45 | /** |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $format; |
||
49 | |||
50 | /** |
||
51 | * @var array |
||
52 | */ |
||
53 | protected static $formats; |
||
54 | |||
55 | /** |
||
56 | * The constructor class. |
||
57 | * |
||
58 | * @param array $request The request parameters (default empty). |
||
59 | * @param array $query The query parameters (default empty). |
||
60 | * @param array $server The server parameters (default empty). |
||
61 | */ |
||
62 | public function __construct(array $request = [], array $query = [], array $server = []) |
||
66 | |||
67 | /** |
||
68 | * Initializes current request. |
||
69 | * |
||
70 | * @param array $request The POST parameters (default empty). |
||
71 | * @param array $query The GET parameters (default empty). |
||
72 | * @param array $server The SERVER parameters (default empty). |
||
73 | */ |
||
74 | public function init(array $request = [], array $query = [], array $server = []) |
||
81 | |||
82 | /** |
||
83 | * Create a static instance of this class. |
||
84 | * |
||
85 | * @param string $uri The uri. |
||
86 | * @param string $query The method of request. |
||
87 | * @param array $request The parameters of request. |
||
88 | * @param array $server The server parameters. |
||
89 | * @param string $format The format of current request. |
||
90 | * |
||
91 | * @return \static |
||
92 | */ |
||
93 | public static function create($uri = null, array $query = [], array $request = [], array $server = [], $format = null) |
||
116 | |||
117 | /** |
||
118 | * The getter for request. |
||
119 | * |
||
120 | * @return ParameterBag |
||
121 | */ |
||
122 | public function getRequest() |
||
126 | |||
127 | /** |
||
128 | * The getter for query. |
||
129 | * |
||
130 | * @return ParameterBag |
||
131 | */ |
||
132 | public function getQuery() |
||
136 | |||
137 | /** |
||
138 | * The getter for server. |
||
139 | * |
||
140 | * @return ParameterBag |
||
141 | */ |
||
142 | public function getServer() |
||
146 | |||
147 | /** |
||
148 | * The getter for headers. |
||
149 | * |
||
150 | * @return HeaderBag |
||
151 | */ |
||
152 | public function getHeaders() |
||
156 | |||
157 | /** |
||
158 | * Builds http headers. |
||
159 | * |
||
160 | * @return array |
||
161 | */ |
||
162 | public function buildHttpHeaders() |
||
180 | /** |
||
181 | * Initilizes the list of formats. |
||
182 | */ |
||
183 | protected static function initFormats() |
||
191 | } |
||
192 |