Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
28 | 97 | public static function validate(string $outputType): string |
|
29 | { |
||
30 | 97 | $outputType = strtolower($outputType); |
|
31 | 97 | if (!self::isValidValue($outputType)) { |
|
32 | 3 | throw new InvalidArgumentException( |
|
33 | 3 | 'The given output type is invalid: ' . $outputType . '. ' . |
|
34 | 3 | 'Allowed are: ' . implode(',', DataType::values()) |
|
35 | ); |
||
36 | } |
||
37 | |||
38 | 94 | return $outputType; |
|
39 | } |
||
40 | } |