Passed
Pull Request — master (#61)
by Tim
02:17
created

AbstractTopLevelSimpleType   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 11 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSchema\XML\xs;
6
7
use SimpleSAML\XML\Assert\Assert;
8
use SimpleSAML\XMLSchema\Exception\SchemaViolationException;
9
use SimpleSAML\XMLSchema\Type\Builtin\{IDValue, NCNameValue};
10
use SimpleSAML\XMLSchema\Type\SimpleDerivationSetValue;
11
12
/**
13
 * Abstract class representing the abstract topLevelSimpleType.
14
 *
15
 * @package simplesamlphp/xml-common
16
 */
17
abstract class AbstractTopLevelSimpleType extends AbstractSimpleType
18
{
19
    /**
20
     * TopLevelSimpleType constructor
21
     *
22
     * @param (
23
     *   \SimpleSAML\XMLSchema\XML\xs\Union|
24
     *   \SimpleSAML\XMLSchema\XML\xs\XsList|
25
     *   \SimpleSAML\XMLSchema\XML\xs\Restriction
26
     * ) $derivation
27
     * @param \SimpleSAML\XMLSchema\Type\Builtin\NCNameValue $name
28
     * @param \SimpleSAML\XMLSchema\Type\SimpleDerivationSetValue $final
29
     * @param \SimpleSAML\XMLSchema\XML\xs\Annotation|null $annotation
30
     * @param \SimpleSAML\XMLSchema\Type\Builtin\IDValue|null $id
31
     * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes
32
     */
33
    public function __construct(
34
        Union|XsList|Restriction $derivation,
35
        NCNameValue $name,
36
        ?SimpleDerivationSetValue $final = null,
37
        ?Annotation $annotation = null,
38
        ?IDValue $id = null,
39
        array $namespacedAttributes = [],
40
    ) {
41
        Assert::notNull($name, SchemaViolationException::class);
42
43
        parent::__construct($derivation, $name, $final, $annotation, $id, $namespacedAttributes);
44
    }
45
}
46