AbstractAlgorithmIdentifierType::toXML()   A
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 6
c 1
b 0
f 0
nc 3
nop 1
dl 0
loc 12
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML\xenc11;
6
7
use DOMElement;
8
use SimpleSAML\XMLSchema\Type\AnyURIValue;
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSchema\Type\AnyURIValue 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
10
use function strval;
11
12
/**
13
 * Class representing <xenc11:AlgorithmIdentifierType>.
14
 *
15
 * @package simplesamlphp/xml-security
16
 */
17
abstract class AbstractAlgorithmIdentifierType extends AbstractXenc11Element
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSecurity\X...1\AbstractXenc11Element 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...
18
{
19
    /**
20
     * AlgorithmIdentifierType constructor.
21
     *
22
     * @param \SimpleSAML\XMLSchema\Type\AnyURIValue $Algorithm
23
     * @param \SimpleSAML\XMLSecurity\XML\xenc11\Parameters|null $parameters
24
     */
25
    public function __construct(
26
        protected AnyURIValue $Algorithm,
27
        protected ?Parameters $parameters = null,
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XMLSecurity\XML\xenc11\Parameters 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...
28
    ) {
29
    }
30
31
32
    /**
33
     * Get the value of the $Algorithm property.
34
     *
35
     * @return \SimpleSAML\XMLSchema\Type\AnyURIValue
36
     */
37
    public function getAlgorithm(): AnyURIValue
38
    {
39
        return $this->Algorithm;
40
    }
41
42
43
    /**
44
     * Get the value of the $parameters property.
45
     *
46
     * @return \SimpleSAML\XMLSecurity\XML\xenc11\Parameters|null
47
     */
48
    public function getParameters(): ?Parameters
49
    {
50
        return $this->parameters;
51
    }
52
53
54
    /**
55
     * @inheritDoc
56
     */
57
    public function toXML(?DOMElement $parent = null): DOMElement
58
    {
59
        $e = $this->instantiateParentElement($parent);
60
        $e->setAttribute('Algorithm', strval($this->getAlgorithm()));
61
62
        if ($this->getParameters() !== null) {
63
            if (!$this->getParameters()->isEmptyElement()) {
64
                $this->getParameters()->toXML($e);
65
            }
66
        }
67
68
        return $e;
69
    }
70
}
71