Total Complexity | 1 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
5 | class StatDefaults 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 | 'ID' => 'int', |
||
13 | 'rating_id' => 'int', |
||
14 | ]; |
||
15 | |||
16 | /** |
||
17 | * The values that should be guarded. |
||
18 | * |
||
19 | * @var string[] |
||
20 | */ |
||
21 | public array $guarded = [ |
||
22 | 'ID', |
||
23 | ]; |
||
24 | |||
25 | /** |
||
26 | * The keys that should be mapped to other keys. |
||
27 | * Keys are mapped before the values are normalized and sanitized. |
||
28 | * Note: Mapped keys should not be included in the defaults! |
||
29 | */ |
||
30 | public array $mapped = [ |
||
31 | 'continentCode' => 'continent', |
||
32 | 'countryCode' => 'country', |
||
33 | ]; |
||
34 | |||
35 | /** |
||
36 | * The values that should be sanitized. |
||
37 | * This is done after $casts and before $enums. |
||
38 | */ |
||
39 | public array $sanitize = [ |
||
40 | 'city' => 'text', |
||
41 | 'continent' => 'text', |
||
42 | 'country' => 'text', |
||
43 | 'region' => 'text', |
||
44 | ]; |
||
45 | |||
46 | protected function defaults(): array |
||
58 |