1 | <?php |
||
9 | class IncomingIlluminateRequest implements IHTTPRequest |
||
10 | { |
||
11 | /** |
||
12 | * The Illuminate request. |
||
13 | * |
||
14 | * @var Request |
||
15 | */ |
||
16 | private $request; |
||
17 | |||
18 | /** |
||
19 | * The request headers. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | private $_headers; |
||
24 | |||
25 | /** |
||
26 | * The incoming url in raw format. |
||
27 | * |
||
28 | * @var string |
||
29 | */ |
||
30 | private $_rawUrl = null; |
||
31 | |||
32 | /** |
||
33 | * The request method (GET, POST, PUT, DELETE or MERGE). |
||
34 | * |
||
35 | * @var HTTPRequestMethod HttpVerb |
||
36 | */ |
||
37 | private $_method; |
||
38 | |||
39 | /** |
||
40 | * The query options as key value. |
||
41 | * |
||
42 | * @var array(string, string); |
||
43 | */ |
||
44 | private $_queryOptions; |
||
45 | |||
46 | /** |
||
47 | * A collection that represents mapping between query |
||
48 | * option and its count. |
||
49 | * |
||
50 | * @var array(string, int) |
||
51 | */ |
||
52 | private $_queryOptionsCount; |
||
53 | |||
54 | /** |
||
55 | * IncomingIlluminateRequest constructor. |
||
56 | * |
||
57 | * @param Request $request |
||
58 | */ |
||
59 | public function __construct(Request $request) |
||
|
|||
60 | { |
||
61 | $this->request = $request; |
||
62 | $this->_headers = null; |
||
63 | $this->_queryOptions = null; |
||
64 | $this->_queryOptionsCount = null; |
||
65 | $this->_method = new HTTPRequestMethod($this->request->getMethod()); |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @return string RequestURI called by User with the value of QueryString |
||
70 | */ |
||
71 | public function getRawUrl() |
||
77 | |||
78 | /** |
||
79 | * @param string $key The header name |
||
80 | * |
||
81 | * @return array|null|string |
||
82 | */ |
||
83 | public function getRequestHeader($key) |
||
93 | |||
94 | /** |
||
95 | * Returns the Query String Parameters (QSPs) as an array of KEY-VALUE pairs. If a QSP appears twice |
||
96 | * it will have two entries in this array. |
||
97 | * |
||
98 | * @return array |
||
99 | */ |
||
100 | public function getQueryParameters() |
||
118 | |||
119 | /** |
||
120 | * @return HTTPRequestMethod |
||
121 | */ |
||
122 | public function getMethod() |
||
126 | |||
127 | /** |
||
128 | * @return array|mixed |
||
129 | */ |
||
130 | public function getAllInput() |
||
134 | } |
||
135 |