Code Duplication    Length = 8-8 lines in 2 locations

src/SAML2/XML/md/EntitiesDescriptor.php 1 location

@@ 113-120 (lines=8) @@
110
        assert('is_array($this->Extensions)');
111
        assert('is_array($this->children)');
112
113
        if ($parent === null) {
114
            $doc = DOMDocumentFactory::create();
115
            $e = $doc->createElementNS(Constants::NS_MD, 'md:EntitiesDescriptor');
116
            $doc->appendChild($e);
117
        } else {
118
            $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, 'md:EntitiesDescriptor');
119
            $parent->appendChild($e);
120
        }
121
122
        if (isset($this->ID)) {
123
            $e->setAttribute('ID', $this->ID);

src/SAML2/XML/md/EntityDescriptor.php 1 location

@@ 201-208 (lines=8) @@
198
        assert('is_array($this->ContactPerson)');
199
        assert('is_array($this->AdditionalMetadataLocation)');
200
201
        if ($parent === null) {
202
            $doc = DOMDocumentFactory::create();
203
            $e = $doc->createElementNS(Constants::NS_MD, 'md:EntityDescriptor');
204
            $doc->appendChild($e);
205
        } else {
206
            $e = $parent->ownerDocument->createElementNS(Constants::NS_MD, 'md:EntityDescriptor');
207
            $parent->appendChild($e);
208
        }
209
210
        $e->setAttribute('entityID', $this->entityID);
211