@@ -16,11 +16,18 @@ |
||
16 | 16 | |
17 | 17 | protected $contentTypes = array('text/xml', 'application/xml'); |
18 | 18 | |
19 | + /** |
|
20 | + * @param boolean $isIndex |
|
21 | + */ |
|
19 | 22 | private function getSchema($isIndex) |
20 | 23 | { |
21 | 24 | return ($isIndex) ? __DIR__ . '/' . self::INDEX : __DIR__ . '/' . self::SCHEMA; |
22 | 25 | } |
23 | 26 | |
27 | + /** |
|
28 | + * @param \Psr\Http\Message\StreamInterface $body |
|
29 | + * @param string $filename |
|
30 | + */ |
|
24 | 31 | private function validateBody($body, $filename, $isIndex = TRUE) |
25 | 32 | { |
26 | 33 | $dom = new \DOMDocument(); |
@@ -29,13 +29,13 @@ discard block |
||
29 | 29 | private function getSchema($isIndex) |
30 | 30 | { |
31 | 31 | if ($isIndex) { |
32 | - return __DIR__ . '/' . self::INDEX; |
|
32 | + return __DIR__.'/'.self::INDEX; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | if ($this->strictMode) { |
36 | - return __DIR__ . '/' . self::SCHEMA; |
|
36 | + return __DIR__.'/'.self::SCHEMA; |
|
37 | 37 | } else { |
38 | - return __DIR__ . '/' . self::NON_STRICT_SCHEMA; |
|
38 | + return __DIR__.'/'.self::NON_STRICT_SCHEMA; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | if (!$valid) { |
50 | 50 | $lastError = libxml_get_last_error(); |
51 | 51 | throw new ValidationFailedException( |
52 | - 'The given sitemap file (' . $filename . ') did not validate against the sitemap schema (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
52 | + 'The given sitemap file ('.$filename.') did not validate against the sitemap schema (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
53 | 53 | } |
54 | 54 | } |
55 | 55 |
@@ -21,8 +21,8 @@ |
||
21 | 21 | if (!$success) { |
22 | 22 | $lastError = libxml_get_last_error(); |
23 | 23 | |
24 | - throw new ValidationFailedException('The xml file ' . $response->getUri() . ' is not well formed (last error: ' . |
|
25 | - str_replace("\n", '', $lastError->message) . ').'); |
|
24 | + throw new ValidationFailedException('The xml file '.$response->getUri().' is not well formed (last error: '. |
|
25 | + str_replace("\n", '', $lastError->message).').'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
@@ -65,17 +65,17 @@ |
||
65 | 65 | |
66 | 66 | if ($jsonValue === FALSE || (is_array($jsonValue) && empty($jsonValue))) { |
67 | 67 | $error = true; |
68 | - $noCorrectJsonPaths[] = $path['pattern'] . ' (JSON Path not found)'; |
|
68 | + $noCorrectJsonPaths[] = $path['pattern'].' (JSON Path not found)'; |
|
69 | 69 | } |
70 | 70 | if ($this->checkRelation($path['relation'], $path['value'], $count) === false) { |
71 | 71 | $error = true; |
72 | - $noCorrectJsonPaths[] = $path['pattern'] . ' (number of JSONPaths is not correct corresponding to the given relation/value)'; |
|
72 | + $noCorrectJsonPaths[] = $path['pattern'].' (number of JSONPaths is not correct corresponding to the given relation/value)'; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
76 | 76 | if ($error === true) { |
77 | 77 | $allNoCorrectJsonPaths = implode('", "', $noCorrectJsonPaths); |
78 | - throw new ValidationFailedException('Disonances with JSON Paths "' . $allNoCorrectJsonPaths . '!'); |
|
78 | + throw new ValidationFailedException('Disonances with JSON Paths "'.$allNoCorrectJsonPaths.'!'); |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
@@ -46,7 +46,7 @@ |
||
46 | 46 | if ($error === true) { |
47 | 47 | $allNotFoundSelectors = implode('", "', $snotFoundSelectors); |
48 | 48 | |
49 | - throw new ValidationFailedException('CSS Selector "' . $allNotFoundSelectors . '" not found in DOM.'); |
|
49 | + throw new ValidationFailedException('CSS Selector "'.$allNotFoundSelectors.'" not found in DOM.'); |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 | } |