Code Duplication    Length = 6-6 lines in 2 locations

src/SAML2/Assertion.php 1 location

@@ 1240-1245 (lines=6) @@
1237
     */
1238
    public function toXML(\DOMNode $parentElement = null)
1239
    {
1240
        if ($parentElement === null) {
1241
            $document = DOMDocumentFactory::create();
1242
            $parentElement = $document;
1243
        } else {
1244
            $document = $parentElement->ownerDocument;
1245
        }
1246
1247
        $root = $document->createElementNS(Constants::NS_SAML, 'saml:' . 'Assertion');
1248
        $parentElement->appendChild($root);

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);