| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class ShortcodeApiFetchDefaults 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 | 'include' => 'array', |
||
| 15 | ]; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The values that should be sanitized. |
||
| 19 | * This is done after $casts and before $enums. |
||
| 20 | */ |
||
| 21 | public array $sanitize = [ |
||
| 22 | 'include' => 'array-int', |
||
| 23 | 'option' => 'name', |
||
| 24 | 'search' => 'text', |
||
| 25 | 'shortcode' => 'name', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | protected function defaults(): array |
||
| 29 | { |
||
| 30 | return [ |
||
| 31 | 'include' => '', |
||
| 32 | 'option' => '', |
||
| 33 | 'search' => '', |
||
| 34 | 'shortcode' => '', |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Finalize provided values, this always runs last. |
||
| 40 | */ |
||
| 41 | protected function finalize(array $values = []): array |
||
| 48 | } |
||
| 49 | } |
||
| 50 |