Completed
Push — master ( c5787e...82096a )
by Nils
01:42
created
src/Rules/Xml/XmlValidXsdRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 
23 23
     protected function doValidation(ResponseInterface $response)
24 24
     {
25
-        $body = (string)$response->getBody();
25
+        $body = (string) $response->getBody();
26 26
 
27 27
         $dom = new \DOMDocument();
28 28
         @$dom->loadXML($body);
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
                 $error = true;
38 38
                 $lastError = libxml_get_last_error();
39 39
 
40
-                $messageParts[] = $xsdFile['xsdfilename'] . ' - ' . $xsdFile['xsdfileurl'] . ' (last error: ' . str_replace("\n", '', $lastError->message) . ').';
40
+                $messageParts[] = $xsdFile['xsdfilename'].' - '.$xsdFile['xsdfileurl'].' (last error: '.str_replace("\n", '', $lastError->message).').';
41 41
             }
42 42
         }
43 43
 
44 44
         if ($error === true) {
45
-            $message = 'XML file (' . (string)$response->getUri() . ')  does not validate against the following XSD files: ' . implode(', ', $messageParts);
45
+            $message = 'XML file ('.(string) $response->getUri().')  does not validate against the following XSD files: '.implode(', ', $messageParts);
46 46
             throw new ValidationFailedException($message);
47 47
         }
48 48
     }
Please login to merge, or discard this patch.
src/Rules/Json/JsonPathExistsRule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
     public function doValidation(ResponseInterface $response)
56 56
     {
57
-        $body = (string)$response->getBody();
57
+        $body = (string) $response->getBody();
58 58
 
59 59
         $json = json_decode($body);
60 60
 
@@ -73,17 +73,17 @@  discard block
 block discarded – undo
73 73
 
74 74
             if ($jsonValue === false || (is_array($jsonValue) && empty($jsonValue))) {
75 75
                 $error = true;
76
-                $noCorrectJsonPaths[] = $path['pattern'] . ' (JSON path not found)';
76
+                $noCorrectJsonPaths[] = $path['pattern'].' (JSON path not found)';
77 77
             }
78
-            if ($this->checkRelation($path['relation'], (int)$path['value'], $count) === false) {
78
+            if ($this->checkRelation($path['relation'], (int) $path['value'], $count) === false) {
79 79
                 $error = true;
80
-                $noCorrectJsonPaths[] = $path['pattern'] . ' (' . $count . ' elements found, expected ' . $path['relation'] . ' ' . $path['value'] . ')';
80
+                $noCorrectJsonPaths[] = $path['pattern'].' ('.$count.' elements found, expected '.$path['relation'].' '.$path['value'].')';
81 81
             }
82 82
         }
83 83
 
84 84
         if ($error === true) {
85 85
             $allNoCorrectJsonPaths = implode('", "', $noCorrectJsonPaths);
86
-            throw new ValidationFailedException('Disonances with JSON Paths "' . $allNoCorrectJsonPaths . '!');
86
+            throw new ValidationFailedException('Disonances with JSON Paths "'.$allNoCorrectJsonPaths.'!');
87 87
         }
88 88
     }
89 89
 }
Please login to merge, or discard this patch.
src/Rules/Html/InsecureContentRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             return;
37 37
         }
38 38
 
39
-        $htmlDocument = new Document((string)$response->getBody());
39
+        $htmlDocument = new Document((string) $response->getBody());
40 40
 
41 41
         $resources = $htmlDocument->getDependencies($uri, false);
42 42
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             if ($resource->getScheme() && 'https' !== $resource->getScheme()) {
47 47
                 $excluded = false;
48 48
                 foreach ($this->excludedFiles as $excludedFile) {
49
-                    if (preg_match('*' . $excludedFile . '*', (string)$resource)) {
49
+                    if (preg_match('*'.$excludedFile.'*', (string) $resource)) {
50 50
                         $excluded = true;
51 51
                         break;
52 52
                     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         if (count($unsecures) > 0) {
61 61
             $message = 'At least one dependency was found on a secure url, that was transfered insecure.<ul>';
62 62
             foreach ($unsecures as $unsecure) {
63
-                $message .= '<li>' . (string)$unsecure . '</li>';
63
+                $message .= '<li>'.(string) $unsecure.'</li>';
64 64
             }
65 65
             $message .= '</ul>';
66 66
             return new CheckResult(CheckResult::STATUS_FAILURE, $message, count($unsecures));
Please login to merge, or discard this patch.
src/Rules/Http/HttpsCertificateExpireRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         $validTo = date('d.m.Y H:i:s', $certInfo['validTo_time_t']);
27 27
 
28 28
         if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) {
29
-            $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']';
29
+            $errorMessage = 'Certificate is expired. ['.$validFrom.' - '.$validTo.']';
30 30
 
31 31
             $result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage);
32 32
             $infoJson = json_encode($certInfo);
@@ -36,14 +36,14 @@  discard block
 block discarded – undo
36 36
                 $result->addAttribute(new Attribute('certificate information', $infoJson, true));
37 37
             }
38 38
             return $result;
39
-        } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) {
40
-            $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo;
39
+        } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) {
40
+            $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo;
41 41
 
42 42
             $result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage);
43 43
             $result->addAttribute(new Attribute('certificate information', json_encode($certInfo), true));
44 44
             return $result;
45 45
         }
46 46
 
47
-        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next ' . $this->expireWarningTime . ' days. Expire date: ' . $validTo . '.');
47
+        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next '.$this->expireWarningTime.' days. Expire date: '.$validTo.'.');
48 48
     }
49 49
 }
Please login to merge, or discard this patch.
src/Rules/Xml/Rss/ValidRule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -18,12 +18,12 @@  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
     public function doValidation(ResponseInterface $response)
25 25
     {
26
-        $body = (string)$response->getBody();
26
+        $body = (string) $response->getBody();
27 27
         if (preg_match('/<rss/', $body)) {
28 28
             libxml_clear_errors();
29 29
             $dom = new \DOMDocument();
@@ -31,17 +31,17 @@  discard block
 block discarded – undo
31 31
             $lastError = libxml_get_last_error();
32 32
             if ($lastError) {
33 33
                 throw new ValidationFailedException(
34
-                    'The given xml file is not well formed (last error: ' .
35
-                    str_replace("\n", '', $lastError->message) . ').');
34
+                    'The given xml file is not well formed (last error: '.
35
+                    str_replace("\n", '', $lastError->message).').');
36 36
             }
37 37
             $valid = @$dom->schemaValidate($this->getSchema());
38 38
             if (!$valid) {
39 39
                 $lastError = libxml_get_last_error();
40 40
                 $lastErrorMessage = str_replace("\n", '', $lastError->message);
41 41
                 throw new ValidationFailedException(
42
-                    'The given xml file did not validate against ' .
43
-                    $this->getSchema() . ' (last error: ' .
44
-                    $lastErrorMessage . ').');
42
+                    'The given xml file did not validate against '.
43
+                    $this->getSchema().' (last error: '.
44
+                    $lastErrorMessage.').');
45 45
             }
46 46
         }
47 47
     }
Please login to merge, or discard this patch.