AbstractTopLevelElement::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 31
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 15
nc 1
nop 14
dl 0
loc 31
rs 9.7666
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSchema\XML;
6
7
use SimpleSAML\XMLSchema\Type\BooleanValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\BooleanValue 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...
8
use SimpleSAML\XMLSchema\Type\IDValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\IDValue 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...
9
use SimpleSAML\XMLSchema\Type\NCNameValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\NCNameValue 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...
10
use SimpleSAML\XMLSchema\Type\QNameValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\QNameValue 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...
11
use SimpleSAML\XMLSchema\Type\Schema\BlockSetValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\Schema\BlockSetValue 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...
12
use SimpleSAML\XMLSchema\Type\Schema\DerivationSetValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Typ...hema\DerivationSetValue 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...
13
use SimpleSAML\XMLSchema\Type\StringValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\StringValue 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...
14
15
/**
16
 * Abstract class representing the topLevelElement-type.
17
 *
18
 * @package simplesamlphp/xml-common
19
 */
20
abstract class AbstractTopLevelElement extends AbstractElement
21
{
22
    /**
23
     * Element constructor
24
     *
25
     * @param \SimpleSAML\XMLSchema\Type\NCNameValue $name
26
     * @param \SimpleSAML\XMLSchema\XML\LocalSimpleType|\SimpleSAML\XMLSchema\XML\LocalComplexType|null $localType
27
     * @param array<\SimpleSAML\XMLSchema\XML\Interface\IdentityConstraintInterface> $identityConstraint
28
     * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $type
29
     * @param \SimpleSAML\XMLSchema\Type\QNameValue|null $substitutionGroup
30
     * @param \SimpleSAML\XMLSchema\Type\StringValue|null $default
31
     * @param \SimpleSAML\XMLSchema\Type\StringValue|null $fixed
32
     * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $nillable
33
     * @param \SimpleSAML\XMLSchema\Type\BooleanValue|null $abstract
34
     * @param \SimpleSAML\XMLSchema\Type\Schema\DerivationSetValue|null $final
35
     * @param \SimpleSAML\XMLSchema\Type\Schema\BlockSetValue|null $block
36
     * @param \SimpleSAML\XMLSchema\XML\Annotation|null $annotation
37
     * @param \SimpleSAML\XMLSchema\Type\IDValue|null $id
38
     * @param array<\SimpleSAML\XML\Attribute> $namespacedAttributes
39
     */
40
    public function __construct(
41
        NCNameValue $name,
42
        LocalSimpleType|LocalComplexType|null $localType = null,
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\XML\LocalComplexType 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...
Bug introduced by
The type SimpleSAML\XMLSchema\XML\LocalSimpleType 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...
43
        array $identityConstraint = [],
44
        ?QNameValue $type = null,
45
        ?QNameValue $substitutionGroup = null,
46
        ?StringValue $default = null,
47
        ?StringValue $fixed = null,
48
        ?BooleanValue $nillable = null,
49
        ?BooleanValue $abstract = null,
50
        ?DerivationSetValue $final = null,
51
        ?BlockSetValue $block = null,
52
        ?Annotation $annotation = null,
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\XML\Annotation 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...
53
        ?IDValue $id = null,
54
        array $namespacedAttributes = [],
55
    ) {
56
        parent::__construct(
57
            name: $name,
58
            localType: $localType,
59
            identityConstraint: $identityConstraint,
60
            type: $type,
61
            substitutionGroup: $substitutionGroup,
62
            default: $default,
63
            fixed: $fixed,
64
            nillable: $nillable,
65
            abstract: $abstract,
66
            final: $final,
67
            block: $block,
68
            annotation: $annotation,
69
            id: $id,
70
            namespacedAttributes: $namespacedAttributes,
71
        );
72
    }
73
}
74