PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.0.13
Kirki – Freeform Page Builder, Website Builder & Customizer v6.0.13
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / libraries / framework / Contracts / Request.php
kirki / libraries / framework / Contracts Last commit date
Support 3 weeks ago Action.php 3 weeks ago Cacheable.php 3 weeks ago Capability.php 3 weeks ago CastAttribute.php 3 weeks ago Constant.php 3 weeks ago Container.php 3 weeks ago Discoverable.php 3 weeks ago Event.php 3 weeks ago Exportable.php 3 weeks ago Importable.php 3 weeks ago Middleware.php 3 weeks ago Migration.php 3 weeks ago Parser.php 3 weeks ago Registrable.php 3 weeks ago Request.php 3 weeks ago Response.php 3 weeks ago RewriteRule.php 3 weeks ago Rule.php 3 weeks ago ServiceProvider.php 3 weeks ago Shortcode.php 3 weeks ago Uploader.php 3 weeks ago
Request.php
306 lines
1 <?php
2
3 /**
4 * Contract for interacting with an HTTP request in a normalized way.
5 * This interface abstracts key methods for accessing request data, headers, routes, and HTTP method.
6 *
7 * @package Framework
8 * @subpackage Contracts
9 * @since 1.0.0
10 */
11 namespace Kirki\Framework\Contracts;
12
13 \defined('ABSPATH') || exit;
14 interface Request
15 {
16 /**
17 * Get the HTTP method of the request (GET, POST, etc).
18 *
19 * @return string
20 *
21 * @since 1.0.0
22 */
23 public function get_method();
24 /**
25 * Get the requested route or endpoint.
26 *
27 * @return string
28 *
29 * @since 1.0.0
30 */
31 public function get_route();
32 /**
33 * Get all HTTP headers from the request.
34 *
35 * @return array
36 *
37 * @since 1.0.0
38 */
39 public function get_headers();
40 /**
41 * Get a single HTTP header from the request.
42 *
43 * @param string $name The name.
44 * @param mixed $default The default.
45 *
46 * @return mixed
47 *
48 * @since 1.0.0
49 */
50 public function get_header(string $name, $default = null);
51 /**
52 * Get all request input attributes.
53 *
54 * @return array
55 *
56 * @since 1.0.0
57 */
58 public function all();
59 /**
60 * Get the validated data from the request.
61 *
62 * @return array|null
63 *
64 * @since 1.0.0
65 */
66 public function validated();
67 /**
68 * Get the sanitized data from the request.
69 *
70 * @return array
71 *
72 * @since 1.0.0
73 */
74 public function sanitized();
75 /**
76 * Get request data excluding specified attributes.
77 *
78 * @param array $attributes Keys to exclude.
79 *
80 * @return array
81 *
82 * @since 1.0.0
83 */
84 public function except(array $attributes);
85 /**
86 * Get a single attribute by key.
87 *
88 * @param string $key The key to retrieve.
89 *
90 * @return mixed|null
91 *
92 * @since 1.0.0
93 */
94 public function only(string $key);
95 /**
96 * Alias of `only()`. Get input value by key.
97 *
98 * @param string $key The key to retrieve.
99 *
100 * @return mixed|null
101 *
102 * @since 1.0.0
103 */
104 public function input(string $key);
105 /**
106 * Get a value from the request with optional default and type casting.
107 *
108 * @param string $key The key to retrieve.
109 * @param mixed $default Default value if the key doesn't exist.
110 * @param string|null $type Optional type to cast the result to:
111 * int, float, bool, string, array with proper sanitization.
112 *
113 * @return mixed
114 *
115 * @since 1.0.0
116 */
117 public function get(string $key, $default = null, $type = null);
118 /**
119 * Check if the request has the provided key
120 *
121 * @param string $key The key.
122 *
123 * @return bool
124 *
125 * @since 1.0.0
126 */
127 public function has(string $key);
128 /**
129 * Get a string value.
130 *
131 * @param string $key The key to retrieve.
132 * @param string|null $default Default value if the key doesn't exist.
133 *
134 * @return string
135 *
136 * @since 1.0.0
137 */
138 public function get_string(string $key, $default = null);
139 /**
140 * Get a safe input value with whitelist.
141 *
142 * @param string $key The key to retrieve.
143 * @param mixed $default Default value if the key doesn't exist.
144 * @param array $whitelist Array of allowed values.
145 *
146 * @return mixed
147 *
148 * @since 1.0.0
149 */
150 public function get_whitelisted(string $key, $default = null, array $whitelist = []);
151 /**
152 * Get a date value.
153 *
154 * @param string $key The key to retrieve.
155 * @param string|null $default Default value if the key doesn't exist.
156 *
157 * @return string
158 *
159 * @since 1.0.0
160 */
161 public function get_date(string $key, $default = null);
162 /**
163 * Get a datetime value.
164 *
165 * @param string $key The key to retrieve.
166 * @param string|null $default Default value if the key doesn't exist.
167 *
168 * @return string
169 *
170 * @since 1.0.0
171 */
172 public function get_datetime(string $key, $default = null);
173 /**
174 * Get a text with sanitization applied.
175 *
176 * @param string $key The key to retrieve.
177 * @param string|null $default Default value if the key doesn't exist.
178 *
179 * @return string|null
180 *
181 * @since 1.0.0
182 */
183 public function get_text(string $key, $default = null);
184 /**
185 * Get a html supported content with sanitization applied.
186 *
187 * @param string $key The key to retrieve.
188 * @param string|null $default Default value if the key doesn't exist.
189 *
190 * @return string|null
191 *
192 * @since 1.0.0
193 */
194 public function get_html(string $key, $default = null);
195 /**
196 * Get a email with sanitization applied.
197 *
198 * @param string $key The key to retrieve.
199 * @param string|null $default Default value if the key doesn't exist.
200 *
201 * @return string|null
202 *
203 * @since 1.0.0
204 */
205 public function get_email(string $key, $default = null);
206 /**
207 * Get a url with sanitization applied.
208 *
209 * @param string $key The key to retrieve.
210 * @param string|null $default Default value if the key doesn't exist.
211 *
212 * @return string|null
213 *
214 * @since 1.0.0
215 */
216 public function get_url(string $key, $default = null);
217 /**
218 * Get a key value with sanitization applied.
219 *
220 * @param string $key The key to retrieve.
221 * @param string|null $default Default value if the key doesn't exist.
222 *
223 * @return string|null
224 *
225 * @since 1.0.0
226 */
227 public function get_key(string $key, $default = null);
228 /**
229 * Get a title value with sanitization applied.
230 *
231 * @param string $key The key to retrieve.
232 * @param string|null $default Default value if the key doesn't exist.
233 *
234 * @return string|null
235 *
236 * @since 1.0.0
237 */
238 public function get_title(string $key, $default = null);
239 /**
240 * Get a file name with sanitization applied.
241 *
242 * @param string $key The key to retrieve.
243 * @param string|null $default Default value if the key doesn't exist.
244 *
245 * @return string|null
246 *
247 * @since 1.0.0
248 */
249 public function get_file_name(string $key, $default = null);
250 /**
251 * Get mime type with sanitization applied.
252 *
253 * @param string $key The key to retrieve.
254 * @param string|null $default Default value if the key doesn't exist.
255 *
256 * @return string|null
257 *
258 * @since 1.0.0
259 */
260 public function get_mime_type(string $key, $default = null);
261 /**
262 * Get an integer value.
263 *
264 * @param string $key The key to retrieve.
265 * @param int|null $default Default value if the key doesn't exist.
266 *
267 * @return int|null
268 *
269 * @since 1.0.0
270 */
271 public function get_int(string $key, $default = null);
272 /**
273 * Get a boolean value.
274 *
275 * @param string $key The key to retrieve.
276 * @param bool $default Default value if the key doesn't exist.
277 *
278 * @return bool
279 *
280 * @since 1.0.0
281 */
282 public function get_bool(string $key, bool $default = \false);
283 /**
284 * Get a float value.
285 *
286 * @param string $key The key to retrieve.
287 * @param float|null $default Default value if the key doesn't exist.
288 *
289 * @return float|null
290 *
291 * @since 1.0.0
292 */
293 public function get_float(string $key, $default = null);
294 /**
295 * Get an array value.
296 *
297 * @param string $key The key to retrieve.
298 * @param array|null $default Default value if the key doesn't exist.
299 *
300 * @return array|null
301 *
302 * @since 1.0.0
303 */
304 public function get_array(string $key, $default = null);
305 }
306