Total Complexity | 1 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class FlagDefaults extends DefaultsAbstract |
||
6 | { |
||
7 | /** |
||
8 | * The values that should be cast before sanitization is run. |
||
9 | * This is done before $sanitize and $enums. |
||
10 | */ |
||
11 | public array $casts = [ |
||
12 | 'data-border' => 'bool', |
||
13 | 'data-radius' => 'bool', |
||
14 | ]; |
||
15 | |||
16 | /** |
||
17 | * The values that should be constrained after sanitization is run. |
||
18 | * This is done after $casts and $sanitize. |
||
19 | */ |
||
20 | public array $enums = [ |
||
21 | 'data-gradient' => [ |
||
22 | '', 'circular', 'diagonal', 'linear', |
||
23 | ], |
||
24 | 'data-shape' => [ |
||
25 | '', 'circle', 'rectangle', 'square', |
||
26 | ], |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * The values that should be sanitized. |
||
31 | * This is done after $casts and before $enums. |
||
32 | */ |
||
33 | public array $sanitize = [ |
||
34 | 'data-gradient' => 'attr', |
||
35 | 'data-shape' => 'attr', |
||
36 | ]; |
||
37 | |||
38 | protected function defaults(): array |
||
48 |