AbstractKeyInfoConfirmationData   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\SAML2\XML\saml;
6
7
use SimpleSAML\SAML2\Assert\Assert;
8
use SimpleSAML\XMLSchema\Exception\MissingElementException;
9
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
10
use SimpleSAML\XMLSecurity\XML\ds\KeyInfo;
11
12
/**
13
 * Abstract class representing SAML 2 KeyInfoConfirmationData element.
14
 *
15
 * @package simplesamlphp/saml2
16
 */
17
abstract class AbstractKeyInfoConfirmationData extends AbstractSubjectConfirmationData
18
{
19
    /**
20
     * Initialize (and parse) a KeyInfoConfirmationData element.
21
     *
22
     * @param \SimpleSAML\XMLSecurity\XML\ds\KeyInfo[] $keyInfo
23
     */
24
    public function __construct(
25
        array $keyInfo = [],
26
    ) {
27
        Assert::allIsInstanceOf($keyInfo, KeyInfo::class, SchemaViolationException::class);
28
        Assert::minCount($keyInfo, 1, MissingElementException::class);
29
30
        parent::__construct(null, null, null, null, null, $keyInfo, []);
31
    }
32
}
33