| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | class LangValue extends LanguageValue implements AttributeTypeInterface |
||
| 16 | { |
||
| 17 | /** @var string */ |
||
| 18 | public const SCHEMA_TYPE = 'xs:language'; |
||
| 19 | |||
| 20 | |||
| 21 | /** |
||
| 22 | * Validate the value. |
||
| 23 | * |
||
| 24 | * @param string $value |
||
| 25 | * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure |
||
| 26 | * @return void |
||
| 27 | */ |
||
| 28 | protected function validateValue(string $value): void |
||
| 29 | { |
||
| 30 | $sanitized = $this->sanitizeValue($value); |
||
| 31 | |||
| 32 | if ($sanitized !== '') { |
||
| 33 | parent::validateValue($sanitized); |
||
| 34 | } |
||
| 35 | } |
||
| 36 | |||
| 37 | |||
| 38 | /** |
||
| 39 | * Convert this value to an attribute |
||
| 40 | * |
||
| 41 | * @return \SimpleSAML\XML\Attribute |
||
| 42 | */ |
||
| 43 | public function toAttribute(): Attribute |
||
| 46 | } |
||
| 47 | } |
||
| 48 |