Code Duplication    Length = 11-11 lines in 2 locations

src/voku/helper/XmlDomParser.php 1 location

@@ 139-149 (lines=11) @@
136
137
        $documentFound = false;
138
        $sxe = \simplexml_load_string($xml, \SimpleXMLElement::class, $optionsXml);
139
        if ($sxe !== false && \count(\libxml_get_errors()) === 0) {
140
            $domElementTmp = \dom_import_simplexml($sxe);
141
            if (
142
                $domElementTmp
143
                &&
144
                $domElementTmp->ownerDocument !== null
145
            ) {
146
                $documentFound = true;
147
                $this->document = $domElementTmp->ownerDocument;
148
            }
149
        }
150
151
        if ($documentFound === false) {
152

src/voku/helper/HtmlDomParser.php 1 location

@@ 361-371 (lines=11) @@
358
359
        $documentFound = false;
360
        $sxe = \simplexml_load_string($html, \SimpleXMLElement::class, $optionsXml);
361
        if ($sxe !== false && \count(\libxml_get_errors()) === 0) {
362
            $domElementTmp = \dom_import_simplexml($sxe);
363
            if (
364
                $domElementTmp
365
                &&
366
                $domElementTmp->ownerDocument !== null
367
            ) {
368
                $documentFound = true;
369
                $this->document = $domElementTmp->ownerDocument;
370
            }
371
        }
372
373
        if ($documentFound === false) {
374