Total Complexity | 1 |
Total Lines | 39 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class QueryAjaxDefaults extends DefaultsAbstract |
||
8 | { |
||
9 | /** |
||
10 | * The values that should be cast before sanitization is run. |
||
11 | * This is done before $sanitize and $enums. |
||
12 | */ |
||
13 | public array $casts = [ |
||
14 | 'post_id' => 'int', |
||
15 | ]; |
||
16 | |||
17 | /** |
||
18 | * The keys that should be mapped to other keys. |
||
19 | * Keys are mapped before the values are normalized and sanitized. |
||
20 | * Note: Mapped keys should not be included in the defaults! |
||
21 | */ |
||
22 | public array $mapped = [ |
||
23 | 'editor_post_id' => 'post_id', |
||
24 | 'id' => 'include', |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * The values that should be sanitized. |
||
29 | * This is done after $casts and before $enums. |
||
30 | */ |
||
31 | public array $sanitize = [ |
||
32 | 'include' => 'text', |
||
33 | 'option' => 'name', |
||
34 | 'search' => 'text', |
||
35 | 'shortcode' => 'name', |
||
36 | ]; |
||
37 | |||
38 | protected function defaults(): array |
||
49 |