Code Duplication    Length = 8-8 lines in 2 locations

src/SAML2/Assertion.php 2 locations

@@ 1489-1496 (lines=8) @@
1486
                    $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:nil', 'true');
1487
                }
1488
1489
                if ($value instanceof \DOMNodeList) {
1490
                    for ($i = 0; $i < $value->length; $i++) {
1491
                        $node = $document->importNode($value->item($i), true);
1492
                        $attributeValue->appendChild($node);
1493
                    }
1494
                } else {
1495
                    $attributeValue->appendChild($document->createTextNode($value));
1496
                }
1497
            }
1498
        }
1499
    }
@@ 1543-1550 (lines=8) @@
1540
                    $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:type', $type);
1541
                }
1542
1543
                if ($value instanceof \DOMNodeList) {
1544
                    for ($i = 0; $i < $value->length; $i++) {
1545
                        $node = $document2->importNode($value->item($i), true);
1546
                        $attributeValue->appendChild($node);
1547
                    }
1548
                } else {
1549
                    $attributeValue->appendChild($document2->createTextNode($value));
1550
                }
1551
            }
1552
            /*Once the attribute nodes are built, the are encrypted*/
1553
            $EncAssert = new XMLSecEnc();