1 | <?php |
||
7 | class Request |
||
8 | { |
||
9 | /** |
||
10 | * Application Object |
||
11 | * |
||
12 | * @var \System\Application |
||
13 | */ |
||
14 | private $app; |
||
15 | |||
16 | /** |
||
17 | * Url |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private $url; |
||
22 | |||
23 | /** |
||
24 | * Base Url |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $baseUrl; |
||
29 | |||
30 | /** |
||
31 | * Host |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | private $host; |
||
36 | |||
37 | /** |
||
38 | * Constructor |
||
39 | * |
||
40 | * @param \System\Application $app |
||
41 | */ |
||
42 | public function __construct(Application $app) |
||
46 | |||
47 | /** |
||
48 | * Prepare url |
||
49 | * |
||
50 | * @return void |
||
51 | */ |
||
52 | public function prepareUrl() |
||
70 | |||
71 | /** |
||
72 | * Get value from spcefic request type |
||
73 | * |
||
74 | * @param array $requestType |
||
75 | * @param string $key |
||
76 | * @return mixed |
||
77 | */ |
||
78 | private function getValueOfRequest($requestType, $key) |
||
90 | |||
91 | /** |
||
92 | * Get value from $_GET by the given key |
||
93 | * |
||
94 | * @param string $key |
||
95 | * @return mixed |
||
96 | */ |
||
97 | public function get($key = null) |
||
104 | |||
105 | /** |
||
106 | * Get value from $_POST by the given key |
||
107 | * |
||
108 | * @param string $key |
||
109 | * @return mixed |
||
110 | */ |
||
111 | public function post($key = null) |
||
118 | |||
119 | /** |
||
120 | * Get value from $_FILES by the given key |
||
121 | * |
||
122 | * @return mixed |
||
123 | */ |
||
124 | public function file($key = null) |
||
131 | |||
132 | /** |
||
133 | * Set value To $_POST For the given key |
||
134 | * |
||
135 | * @param string $key |
||
136 | * @param mixed $value |
||
137 | * @return void |
||
138 | */ |
||
139 | public function setPost($key, $value) |
||
143 | |||
144 | /** |
||
145 | * Set value To $_GET For the given key |
||
146 | * |
||
147 | * @param string $key |
||
148 | * @param mixed $value |
||
149 | * @return void |
||
150 | */ |
||
151 | public function setGet($key, $value) |
||
155 | |||
156 | /** |
||
157 | * Set value To $_FILES For the given key |
||
158 | * |
||
159 | * @param string $key |
||
160 | * @param mixed $value |
||
161 | * @return void |
||
162 | */ |
||
163 | public function setFile($key, $value) |
||
167 | |||
168 | /** |
||
169 | * Get value from $_SERVER by the given key |
||
170 | * |
||
171 | * @param string $key |
||
172 | * @return string |
||
173 | */ |
||
174 | public function server($key) |
||
178 | |||
179 | /** |
||
180 | * Get current request method |
||
181 | * |
||
182 | * @return string |
||
183 | */ |
||
184 | public function method() |
||
188 | |||
189 | /** |
||
190 | * Get the referer link |
||
191 | * |
||
192 | * @return string |
||
193 | */ |
||
194 | public function referer() |
||
198 | |||
199 | /** |
||
200 | * Get full url of the script |
||
201 | * |
||
202 | * @return string |
||
203 | */ |
||
204 | public function baseUrl() |
||
208 | |||
209 | /** |
||
210 | * Get only relative url (clean url) |
||
211 | * |
||
212 | * @return string |
||
213 | */ |
||
214 | public function url() |
||
218 | |||
219 | /** |
||
220 | * Get only host |
||
221 | * |
||
222 | * @return string |
||
223 | */ |
||
224 | public function host() |
||
228 | |||
229 | /** |
||
230 | * Check if the request to the admin panel |
||
231 | * |
||
232 | * @return bool |
||
233 | */ |
||
234 | public function isRequestToAdminManagement() |
||
242 | |||
243 | /** |
||
244 | * Check the request method |
||
245 | * |
||
246 | * @return bool |
||
247 | */ |
||
248 | public function isMatchingRequestMethod($methods = ['GET']) |
||
266 | |||
267 | /** |
||
268 | * Check if the request can be Continued |
||
269 | * @property object $load |
||
270 | * @return bool |
||
271 | */ |
||
272 | public function canRequestContinue($middlewares) |
||
288 | } |
||
289 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.