Passed
Push — master ( 9d958a...532318 )
by Tim
02:50
created

EncodingStyleValue   A

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
<?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
    public const string SCHEMA_TYPE = 'encodingStyle';
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_STRING, expecting '=' on line 19 at column 24
Loading history...
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
        Assert::stringNotEmpty($sanitized, SchemaViolationException::class);
32
33
        $list = explode(' ', $sanitized, C::UNBOUNDED_LIMIT);
34
        Assert::allValidAnyURI($list, SchemaViolationException::class);
35
    }
36
}
37