Conditions | 4 |
Paths | 3 |
Total Lines | 19 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
39 | public function toXML(DOMElement $parent = null): DOMElement |
||
40 | { |
||
41 | if ($this->isSigned() === true && $this->signer === null) { |
||
42 | $e = $this->instantiateParentElement($parent); |
||
43 | |||
44 | // We already have a signed document and no signer was set to re-sign it |
||
45 | $node = $e->ownerDocument->importNode($this->xml, true); |
||
46 | return $e->appendChild($node); |
||
47 | } |
||
48 | |||
49 | $e = $this->toUnsignedXML($parent); |
||
50 | |||
51 | if ($this->signer !== null) { |
||
52 | $signedXML = $this->doSign($e); |
||
53 | $signedXML->insertBefore($this->signature->toXML($signedXML), $signedXML->firstChild); |
||
54 | return $signedXML; |
||
55 | } |
||
56 | |||
57 | return $e; |
||
58 | } |
||
60 |