Code Duplication    Length = 8-8 lines in 2 locations

src/SAML2/Assertion.php 2 locations

@@ 1548-1555 (lines=8) @@
1545
                    $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:nil', 'true');
1546
                }
1547
1548
                if ($value instanceof \DOMNodeList) {
1549
                    for ($i = 0; $i < $value->length; $i++) {
1550
                        $node = $document->importNode($value->item($i), true);
1551
                        $attributeValue->appendChild($node);
1552
                    }
1553
                } else {
1554
                    $attributeValue->appendChild($document->createTextNode($value));
1555
                }
1556
            }
1557
        }
1558
    }
@@ 1602-1609 (lines=8) @@
1599
                    $attributeValue->setAttributeNS(Constants::NS_XSI, 'xsi:type', $type);
1600
                }
1601
1602
                if ($value instanceof \DOMNodeList) {
1603
                    for ($i = 0; $i < $value->length; $i++) {
1604
                        $node = $document2->importNode($value->item($i), true);
1605
                        $attributeValue->appendChild($node);
1606
                    }
1607
                } else {
1608
                    $attributeValue->appendChild($document2->createTextNode($value));
1609
                }
1610
            }
1611
            /*Once the attribute nodes are built, the are encrypted*/
1612
            $EncAssert = new XMLSecEnc();