Total Complexity | 3 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
7 | class ControlDefaults 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 | 'enableHover' => 'bool', |
||
15 | 'enableMediaQueries' => 'bool', |
||
16 | ]; |
||
17 | |||
18 | /** |
||
19 | * The values that should be sanitized. |
||
20 | * This is done after $casts and before $enums. |
||
21 | */ |
||
22 | public array $sanitize = [ |
||
23 | 'children' => 'array-consolidate', |
||
24 | 'keywords' => 'array-consolidate', |
||
25 | 'label' => 'text', |
||
26 | 'options' => 'array-consolidate', |
||
27 | 'slug' => 'slug', |
||
28 | ]; |
||
29 | |||
30 | protected function defaults(): array |
||
40 | ]; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * Finalize provided values, this always runs last. |
||
45 | */ |
||
46 | protected function finalize(array $values = []): array |
||
54 |