Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | protected static function validHexBinary(string $value, string $message = ''): void |
||
34 | { |
||
35 | $result = true; |
||
36 | |||
37 | if (filter_var($value, FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => self::$hexbin_regex]]) === false) { |
||
38 | $result = false; |
||
39 | } |
||
40 | |||
41 | if ($result === false) { |
||
42 | throw new InvalidArgumentException(sprintf( |
||
43 | $message ?: '\'%s\' is not a valid hexBinary string', |
||
44 | $value, |
||
45 | )); |
||
49 |