| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 17 | class SimpleDerivationSetValue extends DerivationControlValue |
||
| 18 | { |
||
| 19 | public const string SCHEMA_TYPE = 'simpleDerivationSet'; |
||
|
|
|||
| 20 | |||
| 21 | |||
| 22 | /** |
||
| 23 | * Validate the value. |
||
| 24 | * |
||
| 25 | * @param string $value The value |
||
| 26 | * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure |
||
| 27 | */ |
||
| 28 | protected function validateValue(string $value): void |
||
| 29 | { |
||
| 30 | $sanitized = $this->sanitizeValue($value); |
||
| 31 | |||
| 32 | if ($sanitized !== '#all' && $sanitized !== '') { |
||
| 33 | Assert::allOneOf( |
||
| 34 | explode(' ', $sanitized), |
||
| 35 | array_column( |
||
| 36 | [ |
||
| 37 | DerivationControlEnum::List, |
||
| 38 | DerivationControlEnum::Restriction, |
||
| 39 | DerivationControlEnum::Union, |
||
| 40 | ], |
||
| 41 | 'value', |
||
| 42 | ), |
||
| 43 | SchemaViolationException::class, |
||
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 48 |