Passed
Push — master ( 532795...64c54c )
by Tim
02:07
created

DiscoveryResponse   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\idpdisc;
6
7
use SimpleSAML\Assert\Assert;
8
use SimpleSAML\SAML2\Constants as C;
9
use SimpleSAML\SAML2\XML\md\AbstractIndexedEndpointType;
10
11
/**
12
 * Abstract class to be implemented by all the classes in this namespace
13
 *
14
 * @package simplesamlphp/saml2
15
 *
16
 * @see http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-idp-discovery.html
17
 */
18
final class DiscoveryResponse extends AbstractIndexedEndpointType
19
{
20
    /** @var string */
21
    public const NS = C::NS_IDPDISC;
22
23
    /** @var string */
24
    public const NS_PREFIX = 'idpdisc';
25
26
27
    /**
28
     * DiscoveryResponse constructor.
29
     *
30
     * This is an endpoint with one restriction: it cannot contain a ResponseLocation.
31
     *
32
     * @param int $index
33
     * @param string $binding
34
     * @param string $location
35
     * @param bool|null $isDefault
36
     * @param string|null $unused
37
     * @param list<\SimpleSAML\XML\Attribute> $attributes
0 ignored issues
show
Bug introduced by
The type SimpleSAML\SAML2\XML\idpdisc\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
38
     * @param array $children
39
     *
40
     * @throws \SimpleSAML\Assert\AssertionFailedException
41
     */
42
    public function __construct(
43
        int $index,
44
        string $binding,
45
        string $location,
46
        ?bool $isDefault = null,
47
        ?string $unused = null,
48
        array $attributes = [],
49
        array $children = [],
50
    ) {
51
        Assert::null(
52
            $unused,
53
            'The \'ResponseLocation\' attribute must be omitted for idpdisc:DiscoveryResponse.',
54
        );
55
        parent::__construct($index, $binding, $location, $isDefault, null, $attributes, $children);
56
    }
57
}
58