Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 167-171 (lines=5) @@
164
        }
165
166
        $organization = Utils::xpQuery($xml, './saml_metadata:Organization');
167
        if (count($organization) > 1) {
168
            throw new \Exception('More than one Organization in the entity.');
169
        } elseif (!empty($organization)) {
170
            $this->Organization = new Organization($organization[0]);
171
        }
172
173
        foreach (Utils::xpQuery($xml, './saml_metadata:ContactPerson') as $cp) {
174
            $this->ContactPerson[] = new ContactPerson($cp);

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

@@ 136-140 (lines=5) @@
133
        }
134
135
        $organization = Utils::xpQuery($xml, './saml_metadata:Organization');
136
        if (count($organization) > 1) {
137
            throw new \Exception('More than one Organization in the entity.');
138
        } elseif (!empty($organization)) {
139
            $this->Organization = new Organization($organization[0]);
140
        }
141
142
        foreach (Utils::xpQuery($xml, './saml_metadata:ContactPerson') as $cp) {
143
            $this->contactPersons[] = new ContactPerson($cp);