Completed
Push — master ( 133522...10373b )
by Nils
02:47
created
src/Rules/Xml/Sitemap/ValidRule.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -16,11 +16,18 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@  discard block
 block discarded – undo
27 27
     private function getSchema($isIndex)
28 28
     {
29 29
         if ($isIndex) {
30
-            return __DIR__ . '/' . self::INDEX;
30
+            return __DIR__.'/'.self::INDEX;
31 31
         }
32 32
 
33 33
         if ($this->strictMode) {
34
-            return __DIR__ . '/' . self::SCHEMA;
34
+            return __DIR__.'/'.self::SCHEMA;
35 35
         } else {
36
-            return __DIR__ . '/' . self::NON_STRICT_SCHEMA;
36
+            return __DIR__.'/'.self::NON_STRICT_SCHEMA;
37 37
         }
38 38
     }
39 39
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         if (!$valid) {
47 47
             $lastError = libxml_get_last_error();
48 48
             throw new ValidationFailedException(
49
-                'The given sitemap file (' . $filename . ') did not validate against the sitemap schema (last error: ' . str_replace("\n", '', $lastError->message) . ').');
49
+                'The given sitemap file ('.$filename.') did not validate against the sitemap schema (last error: '.str_replace("\n", '', $lastError->message).').');
50 50
         }
51 51
     }
52 52
 
@@ -74,15 +74,15 @@  discard block
 block discarded – undo
74 74
 
75 75
     protected function doValidation(Response $response)
76 76
     {
77
-        var_dump((string)$response->getUri());
77
+        var_dump((string) $response->getUri());
78 78
 
79 79
         $body = $response->getBody();
80 80
 
81 81
         // sitemapindex or urlset
82 82
         if (preg_match('/<sitemapindex/', $body)) {
83
-            $this->validateBody($body, (string)$response->getUri());
83
+            $this->validateBody($body, (string) $response->getUri());
84 84
         } elseif (preg_match('/<urlset/', $body)) {
85
-            $this->validateBody($body, (string)$response->getUri(), false);
85
+            $this->validateBody($body, (string) $response->getUri(), false);
86 86
         }
87 87
     }
88 88
 }
Please login to merge, or discard this patch.
src/Rules/Xml/XmlCheckRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Rules/Html/CssSelectorExistsRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.