Completed
Push — master ( 1a4aa3...37855c )
by Nils
01:58
created
src/Rules/Xml/Sitemap/ValidRule.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,13 +36,13 @@  discard block
 block discarded – undo
36 36
     private function getSchema($isIndex)
37 37
     {
38 38
         if ($isIndex) {
39
-            return __DIR__ . '/' . self::INDEX;
39
+            return __DIR__.'/'.self::INDEX;
40 40
         }
41 41
 
42 42
         if ($this->strictMode) {
43
-            return __DIR__ . '/' . self::SCHEMA;
43
+            return __DIR__.'/'.self::SCHEMA;
44 44
         } else {
45
-            return __DIR__ . '/' . self::NON_STRICT_SCHEMA;
45
+            return __DIR__.'/'.self::NON_STRICT_SCHEMA;
46 46
         }
47 47
     }
48 48
 
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
 
62 62
         if (!$valid) {
63 63
             $lastError = libxml_get_last_error();
64
-            $message = 'The given sitemap file (' . $filename . ') did not validate against the sitemap schema (last error: ' . str_replace("\n", '', $lastError->message) . ').';
64
+            $message = 'The given sitemap file ('.$filename.') did not validate against the sitemap schema (last error: '.str_replace("\n", '', $lastError->message).').';
65 65
             return new CheckResult(CheckResult::STATUS_FAILURE, $message);
66 66
         } else {
67
-            $message = 'The given sitemap file (' . $filename . ') is valid.';
67
+            $message = 'The given sitemap file ('.$filename.') is valid.';
68 68
             return new CheckResult(CheckResult::STATUS_FAILURE, $message);
69 69
 
70 70
         }
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
         $contentType = $response->getHeader('content-type');
80 80
 
81 81
         if ($response instanceof DomAwareResponse) {
82
-            $body = (string)$response->getHtmlBody();
82
+            $body = (string) $response->getHtmlBody();
83 83
         } else {
84
-            $body = (string)$response->getBody();
84
+            $body = (string) $response->getBody();
85 85
         }
86 86
 
87 87
         if (is_array($contentType) && in_array(strtolower($contentType[0]), $this->gzipContentTypes)) {
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
 
91 91
         // sitemapindex or urlset
92 92
         if (preg_match('/<sitemapindex/', $body)) {
93
-            return $this->validateBody($body, (string)$response->getUri(), true);
93
+            return $this->validateBody($body, (string) $response->getUri(), true);
94 94
         } elseif (preg_match('/<urlset/', $body)) {
95
-            return $this->validateBody($body, (string)$response->getUri(), false);
95
+            return $this->validateBody($body, (string) $response->getUri(), false);
96 96
         } else {
97 97
             throw new ValidationFailedException('The given document is not a valid sitemap. Nether sitemapindex nor urlset element was found. ');
98 98
         }
Please login to merge, or discard this patch.