Completed
Push — master ( 83fedd...20342f )
by Nils
03:00
created
src/Rules/Xml/Sitemap/ValidRule.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -37,6 +37,7 @@
 block discarded – undo
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) {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Rules/Xml/XmlCheckRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.