Passed
Pull Request — master (#374)
by Tim
11:54 queued 09:21
created

EntityIDValue   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 21
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A validateValue() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\Type;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
use SimpleSAML\SAML2\Constants as C;
9
use SimpleSAML\SAML2\Type\SAMLAnyURIValue;
10
use SimpleSAML\SAML2\XML\md\AbstractMdElement;
11
12
/**
13
 * @package simplesaml/saml2
14
 */
15
class EntityIDValue extends SAMLAnyURIValue
16
{
17
    /** @var string */
18
    public const SCHEMA_TYPE = 'entityIDType';
19
20
    /** @var string */
21
    public const SCHEMA_NAMESPACEURI = C::NS_MD;
22
23
    /** @var string */
24
    public const SCHEMA_NAMESPACE_PREFIX = AbstractMdElement::NS_PREFIX;
25
26
    /**
27
     * Validate the value.
28
     *
29
     * @param string $value
30
     * @return void
31
     */
32
    protected function validateValue(string $value): void
33
    {
34
        // Note: value must already be sanitized before validating
35
        Assert::validEntityID($this->sanitizeValue($value));
36
    }
37
}
38