@@ -42,6 +42,7 @@ discard block |
||
42 | 42 | * @param $status |
43 | 43 | * @param $value |
44 | 44 | * @param $message |
45 | + * @param string $url |
|
45 | 46 | */ |
46 | 47 | public function __construct($status, $message = '', $value = null, $url = null) |
47 | 48 | { |
@@ -73,7 +74,7 @@ discard block |
||
73 | 74 | } |
74 | 75 | |
75 | 76 | /** |
76 | - * @param Attribute $attributes |
|
77 | + * @param Attribute $attribute |
|
77 | 78 | */ |
78 | 79 | public function addAttribute(Attribute $attribute) |
79 | 80 | { |
@@ -136,7 +137,7 @@ discard block |
||
136 | 137 | } |
137 | 138 | |
138 | 139 | /** |
139 | - * @param string $identifier |
|
140 | + * @param string $identifierRule |
|
140 | 141 | */ |
141 | 142 | public function setIdentifierRule($identifierRule) |
142 | 143 | { |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | private function getSchema($isIndex) |
35 | 35 | { |
36 | 36 | if ($isIndex) { |
37 | - return __DIR__ . '/' . self::INDEX; |
|
37 | + return __DIR__.'/'.self::INDEX; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | if ($this->strictMode) { |
41 | - return __DIR__ . '/' . self::SCHEMA; |
|
41 | + return __DIR__.'/'.self::SCHEMA; |
|
42 | 42 | } else { |
43 | - return __DIR__ . '/' . self::NON_STRICT_SCHEMA; |
|
43 | + return __DIR__.'/'.self::NON_STRICT_SCHEMA; |
|
44 | 44 | } |
45 | 45 | } |
46 | 46 | |
@@ -65,10 +65,10 @@ discard block |
||
65 | 65 | |
66 | 66 | if (!$valid) { |
67 | 67 | $lastError = libxml_get_last_error(); |
68 | - $message = 'The given sitemap file (' . $filename . ') did not validate against the sitemap schema (last error: ' . str_replace("\n", '', $lastError->message) . ').'; |
|
68 | + $message = 'The given sitemap file ('.$filename.') did not validate against the sitemap schema (last error: '.str_replace("\n", '', $lastError->message).').'; |
|
69 | 69 | return new CheckResult(CheckResult::STATUS_FAILURE, $message); |
70 | 70 | } else { |
71 | - $message = 'The given sitemap file (' . $filename . ') is valid.'; |
|
71 | + $message = 'The given sitemap file ('.$filename.') is valid.'; |
|
72 | 72 | return new CheckResult(CheckResult::STATUS_SUCCESS, $message); |
73 | 73 | |
74 | 74 | } |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | protected function doValidation(ResponseInterface $response) |
82 | 82 | { |
83 | 83 | if ($response instanceof DomAwareResponse) { |
84 | - $body = (string)$response->getHtmlBody(); |
|
84 | + $body = (string) $response->getHtmlBody(); |
|
85 | 85 | } else { |
86 | - $body = (string)$response->getBody(); |
|
86 | + $body = (string) $response->getBody(); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | if ($response->hasHeader('content-type')) { |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | |
96 | 96 | // sitemapindex or urlset |
97 | 97 | if (preg_match('/<sitemapindex/', $body)) { |
98 | - return $this->validateBody($body, (string)$response->getUri(), true); |
|
98 | + return $this->validateBody($body, (string) $response->getUri(), true); |
|
99 | 99 | } elseif (preg_match('/<urlset/', $body)) { |
100 | - return $this->validateBody($body, (string)$response->getUri(), false); |
|
100 | + return $this->validateBody($body, (string) $response->getUri(), false); |
|
101 | 101 | } else { |
102 | 102 | throw new ValidationFailedException('The given document is not a valid sitemap. Nether sitemapindex nor urlset element was found. '); |
103 | 103 | } |