Conditions | 2 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
30 | public static function validate($string) |
||
31 | { |
||
32 | $errors = []; |
||
33 | |||
34 | $allowedStorageClasses = [ |
||
35 | 'STANDARD', |
||
36 | 'REDUCED_REDUNDANCY', |
||
37 | 'STANDARD_IA', |
||
38 | 'ONEZONE_IA', |
||
39 | 'INTELLIGENT_TIERING', |
||
40 | 'GLACIER', |
||
41 | 'DEEP_ARCHIVE', |
||
42 | ]; |
||
43 | |||
44 | if (!in_array($string, $allowedStorageClasses)) { |
||
45 | $errors[] = 'The string is not a valid StorageClass'; |
||
46 | } |
||
47 | |||
48 | return $errors; |
||
49 | } |
||
51 |