@@ -13,12 +13,12 @@ |
||
13 | 13 | public function doValidation(Response $response) |
14 | 14 | { |
15 | 15 | $domDocument = new \DOMDocument(); |
16 | - $success = @$domDocument->loadXML((string) $response->getBody()); // true/false |
|
16 | + $success = @$domDocument->loadXML((string) $response->getBody()); // true/false |
|
17 | 17 | |
18 | 18 | $lastError = libxml_get_last_error(); |
19 | 19 | if (!$success || $lastError) { |
20 | - throw new \RuntimeException('The xml file '. $response->getUri() . ' is not well formed (last error: ' . |
|
21 | - str_replace("\n", '', $lastError->message) . ').'); |
|
20 | + throw new \RuntimeException('The xml file '.$response->getUri().' is not well formed (last error: '. |
|
21 | + str_replace("\n", '', $lastError->message).').'); |
|
22 | 22 | } |
23 | 23 | } |
24 | 24 | } |
@@ -15,23 +15,23 @@ |
||
15 | 15 | |
16 | 16 | private function getSchema() |
17 | 17 | { |
18 | - return __DIR__ . '/' . self::SCHEMA; |
|
18 | + return __DIR__.'/'.self::SCHEMA; |
|
19 | 19 | } |
20 | 20 | |
21 | - private function validateBody ($body) { |
|
21 | + private function validateBody($body) { |
|
22 | 22 | libxml_clear_errors(); |
23 | 23 | $dom = new \DOMDocument(); |
24 | 24 | @$dom->loadXML($body); |
25 | 25 | $lastError = libxml_get_last_error(); |
26 | 26 | if ($lastError) { |
27 | 27 | throw new ValidationFailedException( |
28 | - 'The given sitemap file is not well formed (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
28 | + 'The given sitemap file is not well formed (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
29 | 29 | } |
30 | 30 | $valid = @$dom->schemaValidate($this->getSchema()); |
31 | 31 | if (!$valid) { |
32 | 32 | $lastError = libxml_get_last_error(); |
33 | 33 | throw new ValidationFailedException( |
34 | - 'The given sitemap file did not validate vs. sitemap.xsd (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
34 | + 'The given sitemap file did not validate vs. sitemap.xsd (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 |