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