| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 39 | 14 | public static function validate(string $flattenFieldType): string |
|
| 40 | { |
||
| 41 | 14 | $flattenFieldType = strtolower($flattenFieldType); |
|
| 42 | 14 | if (!FlattenFieldType::isValidValue($flattenFieldType)) { |
|
| 43 | 1 | throw new InvalidArgumentException( |
|
| 44 | 1 | 'The given flatten field type is invalid: ' . $flattenFieldType . '. ' . |
|
| 45 | 1 | 'Allowed are: ' . implode(', ', FlattenFieldType::values()) |
|
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | 13 | return $flattenFieldType; |
|
| 50 | } |
||
| 51 | } |