Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 2.004 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 14 | private function validateHexadecimal($value) |
|
19 | { |
||
20 | 14 | $isValid = filter_var( |
|
21 | 14 | $value, |
|
22 | 14 | FILTER_VALIDATE_REGEXP, |
|
23 | array( |
||
24 | 14 | "options" => array("regexp" => '`^[0-9A-Fa-f]+$`'), |
|
25 | ) |
||
26 | 14 | ); |
|
27 | 14 | if ($isValid === false) { |
|
28 | 9 | $this->throwInvalidArgumentMustBe("valid hexadecimal"); |
|
29 | } |
||
30 | 5 | } |
|
31 | } |
||
32 |