NameIDMappingService::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 4
dl 0
loc 12
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\md;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
use SimpleSAML\SAML2\Type\SAMLAnyURIValue;
9
use SimpleSAML\XML\SchemaValidatableElementInterface;
10
use SimpleSAML\XML\SchemaValidatableElementTrait;
11
12
/**
13
 * Class representing an md:NameIDMappingService element.
14
 *
15
 * @package simplesamlphp/saml2
16
 */
17
final class NameIDMappingService extends AbstractEndpointType implements SchemaValidatableElementInterface
18
{
19
    use SchemaValidatableElementTrait;
20
21
22
    /**
23
     * NameIDMappingService constructor.
24
     *
25
     * This is an endpoint with one restriction: it cannot contain a ResponseLocation.
26
     *
27
     * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $binding
28
     * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue $location
29
     * @param \SimpleSAML\SAML2\Type\SAMLAnyURIValue|null $unused
30
     * @param array $attributes
31
     * @throws \SimpleSAML\Assert\AssertionFailedException
32
     */
33
    public function __construct(
34
        SAMLAnyURIValue $binding,
35
        SAMLAnyURIValue $location,
36
        ?SAMLAnyURIValue $unused = null,
37
        array $attributes = [],
38
    ) {
39
        Assert::null(
40
            $unused,
41
            'The \'ResponseLocation\' attribute must be omitted for md:NameIDMappingService.',
42
        );
43
44
        parent::__construct($binding, $location, null, $attributes);
45
    }
46
}
47