Code Duplication    Length = 5-8 lines in 2 locations

src/Rules/Xml/Rss/ValidRule.php 1 location

@@ 39-46 (lines=8) @@
36
                    str_replace("\n", '', $lastError->message) . ').');
37
            }
38
            $valid = @$dom->schemaValidate($this->getSchema());
39
            if (!$valid) {
40
                $lastError = libxml_get_last_error();
41
                $lastErrorMessage = str_replace("\n", '', $lastError->message);
42
                throw new ValidationFailedException(
43
                    'The given xml file did not Validate vs. ' .
44
                    $this->getSchema() . ' (last error: ' .
45
                    $lastErrorMessage . ').');
46
            }
47
        }
48
    }
49
}

src/Rules/Xml/Sitemap/ValidRule.php 1 location

@@ 35-39 (lines=5) @@
32
                'The given sitemap file (' . $filename . ') is not well formed (last error: ' . str_replace("\n", '', $lastError->message) . ').');
33
        }
34
        $valid = @$dom->schemaValidate($this->getSchema());
35
        if (!$valid) {
36
            $lastError = libxml_get_last_error();
37
            throw new ValidationFailedException(
38
                'The given sitemap file (' . $filename . ') did not validate against the sitemap.xsd (last error: ' . str_replace("\n", '', $lastError->message) . ').');
39
        }
40
    }
41
42
    /**