| Total Complexity | 2 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class MonthValue extends AbstractAnySimpleType |
||
| 15 | { |
||
| 16 | public const string SCHEMA_TYPE = 'gMonth'; |
||
|
|
|||
| 17 | |||
| 18 | |||
| 19 | /** |
||
| 20 | * Sanitize the value. |
||
| 21 | * |
||
| 22 | * @param string $value The unsanitized value |
||
| 23 | */ |
||
| 24 | protected function sanitizeValue(string $value): string |
||
| 25 | { |
||
| 26 | return static::collapseWhitespace(static::normalizeWhitespace($value)); |
||
| 27 | } |
||
| 28 | |||
| 29 | |||
| 30 | /** |
||
| 31 | * Validate the value. |
||
| 32 | * |
||
| 33 | * @param string $value |
||
| 34 | * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure |
||
| 35 | */ |
||
| 36 | protected function validateValue(string $value): void |
||
| 37 | { |
||
| 38 | Assert::validMonth($this->sanitizeValue($value), SchemaViolationException::class); |
||
| 39 | } |
||
| 40 | } |
||
| 41 |