Code Duplication    Length = 6-6 lines in 2 locations

src/SAML2/EncryptedAssertion.php 1 location

@@ 108-113 (lines=6) @@
105
     */
106
    public function toXML(\DOMNode $parentElement = null)
107
    {
108
        if ($parentElement === null) {
109
            $document = DOMDocumentFactory::create();
110
            $parentElement = $document;
111
        } else {
112
            $document = $parentElement->ownerDocument;
113
        }
114
115
        $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'EncryptedAssertion');
116
        $parentElement->appendChild($root);

src/SAML2/Assertion.php 1 location

@@ 1362-1367 (lines=6) @@
1359
     */
1360
    public function toXML(\DOMNode $parentElement = null)
1361
    {
1362
        if ($parentElement === null) {
1363
            $document = DOMDocumentFactory::create();
1364
            $parentElement = $document;
1365
        } else {
1366
            $document = $parentElement->ownerDocument;
1367
        }
1368
1369
        $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'Assertion');
1370
        $parentElement->appendChild($root);