Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | class HexBinaryValue extends AbstractValueType |
||
16 | { |
||
17 | /** |
||
18 | * Sanitize the value. |
||
19 | * |
||
20 | * Note: There are no processing rules for xs:hexBinary regarding whitespace. General consensus is to strip them |
||
21 | * |
||
22 | * @param string $value The unsanitized value |
||
23 | * @return string |
||
24 | */ |
||
25 | protected function sanitizeValue(string $value): string |
||
26 | { |
||
27 | return str_replace(["\f", "\r", "\n", "\t", "\v", ' '], '', $value); |
||
28 | } |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Validate the value. |
||
33 | * |
||
34 | * @param string $value |
||
35 | * @throws \SimpleSAML\XML\Exception\SchemaViolationException on failure |
||
36 | * @return void |
||
37 | */ |
||
38 | protected function validateValue(string $value): void |
||
45 | ); |
||
46 | } |
||
48 |