@@ -37,6 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @param string |
| 40 | + * @param \Psr\Http\Message\StreamInterface $body |
|
| 40 | 41 | * @return array |
| 41 | 42 | */ |
| 42 | 43 | private function getLocations($body) { |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace whm\Smoke\Rules\Xml\Sitemap; |
| 4 | 4 | |
| 5 | 5 | use whm\Smoke\Http\Response; |
| 6 | -use whm\Smoke\Rules\Rule; |
|
| 7 | 6 | use whm\Smoke\Rules\StandardRule; |
| 8 | 7 | use whm\Smoke\Rules\ValidationFailedException; |
| 9 | 8 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | private function getSchema() |
| 20 | 20 | { |
| 21 | - return __DIR__ . '/' . self::SCHEMA; |
|
| 21 | + return __DIR__.'/'.self::SCHEMA; |
|
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | private function validateBody($body, $filename) |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | $lastError = libxml_get_last_error(); |
| 30 | 30 | if ($lastError) { |
| 31 | 31 | throw new ValidationFailedException( |
| 32 | - 'The given sitemap file (' . $filename . ') is not well formed (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
| 32 | + 'The given sitemap file ('.$filename.') is not well formed (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
| 33 | 33 | } |
| 34 | 34 | $valid = @$dom->schemaValidate($this->getSchema()); |
| 35 | 35 | if (!$valid) { |
| 36 | 36 | $lastError = libxml_get_last_error(); |
| 37 | 37 | throw new ValidationFailedException( |
| 38 | - 'The given sitemap file (' . $filename . ') did not validate against the sitemap.xsd (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
| 38 | + 'The given sitemap file ('.$filename.') did not validate against the sitemap.xsd (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
@@ -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 | } |