Passed
Pull Request — master (#64)
by Tim
02:03
created

AbstractPrimeFieldParamsType::toXML()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML\dsig11;
6
7
use DOMElement;
8
use SimpleSAML\Assert\Assert;
9
use SimpleSAML\XML\Base64ElementTrait;
10
use SimpleSAML\XML\Exception\InvalidDOMElementException;
11
use SimpleSAML\XML\Exception\SchemaViolationException;
12
use SimpleSAML\XMLSecurity\Constants as C;
13
use SimpleSAML\XMLSecurity\Exception\InvalidArgumentException;
14
15
/**
16
 * Abstract class representing a dsig11:PrimeFieldParamsType
17
 *
18
 * @package simplesaml/xml-security
19
 */
20
abstract class AbstractPrimeFieldParamsType extends AbstractDsig11Element
21
{
22
    /**
23
     * Initialize a PrimeFieldParamsType element.
24
     *
25
     * @param \SimpleSAML\XML\dsig11\P $p
0 ignored issues
show
Bug introduced by
The type SimpleSAML\XML\dsig11\P 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...
26
     */
27
    public function __construct(
28
        protected P $p,
29
    ) {
30
    }
31
32
33
    /**
34
     * Collect the value of the p-property
35
     *
36
     * @return \SimpleSAML\XMLSecurity\XML\dsig11\P
37
     */
38
    public function getP(): P
39
    {
40
        return $this->p;
41
    }
42
43
44
    /**
45
     * Convert this PrimeFieldParamsType element to XML.
46
     *
47
     * @param \DOMElement|null $parent The element we should append this PrimeFieldParamsType element to.
48
     * @return \DOMElement
49
     */
50
    public function toXML(?DOMElement $parent = null): DOMElement
51
    {
52
        $e = $this->instantiateParentElement($parent);
53
        $this->getP()->toXML($e);
54
55
        return $e;
56
    }
57
}
58