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

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