EncodingStyleValue   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
c 0
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateValue() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SOAP11\Type;
6
7
use SimpleSAML\SOAP11\Assert\Assert;
8
use SimpleSAML\XML\Constants as C;
9
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
10
use SimpleSAML\XMLSchema\Type\NMTokensValue;
11
12
use function explode;
13
14
/**
15
 * @package simplesaml/xml-soap
16
 */
17
class EncodingStyleValue extends NMTokensValue
18
{
19
    /** @var string */
20
    public const SCHEMA_TYPE = 'encodingStyle';
21
22
23
    /**
24
     * Validate the value.
25
     *
26
     * @param string $value The value
27
     * @throws \SimpleSAML\XMLSchema\Exception\SchemaViolationException on failure
28
     * @return void
29
     */
30
    protected function validateValue(string $value): void
31
    {
32
        $sanitized = $this->sanitizeValue($value);
33
        Assert::stringNotEmpty($sanitized, SchemaViolationException::class);
34
35
        $list = explode(' ', $sanitized, C::UNBOUNDED_LIMIT);
36
        Assert::allValidAnyURI($list, SchemaViolationException::class);
37
    }
38
}
39