Passed
Push — master ( a7f2e0...7bcc2b )
by Tim
02:25
created

AbstractCurveType::toXML()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 8
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace SimpleSAML\XMLSecurity\XML\dsig11;
6
7
use DOMElement;
8
9
/**
10
 * Abstract class representing a dsig11:CurveType
11
 *
12
 * @package simplesaml/xml-security
13
 */
14
abstract class AbstractCurveType extends AbstractDsig11Element
15
{
16
    /**
17
     * Initialize a CurveType element.
18
     *
19
     * @param \SimpleSAML\XMLSecurity\XML\dsig11\A $a
20
     * @param \SimpleSAML\XMLSecurity\XML\dsig11\B $b
21
     */
22
    public function __construct(
23
        protected A $a,
24
        protected B $b,
25
    ) {
26
    }
27
28
29
    /**
30
     * Collect the value of the a-property
31
     *
32
     * @return \SimpleSAML\XMLSecurity\XML\dsig11\A
33
     */
34
    public function getA(): A
35
    {
36
        return $this->a;
37
    }
38
39
40
    /**
41
     * Collect the value of the b-property
42
     *
43
     * @return \SimpleSAML\XMLSecurity\XML\dsig11\B
44
     */
45
    public function getB(): B
46
    {
47
        return $this->b;
48
    }
49
50
51
    /**
52
     * Convert this CurveType element to XML.
53
     *
54
     * @param \DOMElement|null $parent The element we should append this CurveType element to.
55
     * @return \DOMElement
56
     */
57
    public function toXML(?DOMElement $parent = null): DOMElement
58
    {
59
        $e = $this->instantiateParentElement($parent);
60
61
        $this->getA()->toXML($e);
62
        $this->getB()->toXML($e);
63
64
        return $e;
65
    }
66
}
67