Completed
Push — master ( 6da510...33a55e )
by Nils
05:34
created
src/Rules/Http/Header/ExistsRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@
 block discarded – undo
24 24
 
25 25
         foreach ($this->checkedHeaders as $headerConfig) {
26 26
             if (!$response->hasHeader($headerConfig['key'])) {
27
-                throw new ValidationFailedException('Header not found (' . $headerConfig['key'] . ')');
27
+                throw new ValidationFailedException('Header not found ('.$headerConfig['key'].')');
28 28
             }
29 29
 
30 30
             $currentValue = $response->getHeader($headerConfig['key'])[0];
31 31
 
32
-            if (!preg_match('%' . $headerConfig['value'] . '%', $currentValue, $matches)) {
33
-                throw new ValidationFailedException('Header "' . $headerConfig['key'] . '" does not match "' . $headerConfig['value'] . '". Current value is "' . $currentValue . '"');
32
+            if (!preg_match('%'.$headerConfig['value'].'%', $currentValue, $matches)) {
33
+                throw new ValidationFailedException('Header "'.$headerConfig['key'].'" does not match "'.$headerConfig['value'].'". Current value is "'.$currentValue.'"');
34 34
             }
35 35
         }
36 36
     }
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,19 +26,19 @@
 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
             $result->addAttribute(new Attribute('certificate information', json_encode($certInfo), true));
33 33
             return $result;
34
-        } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) {
35
-            $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo;
34
+        } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) {
35
+            $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo;
36 36
 
37 37
             $result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage);
38 38
             $result->addAttribute(new Attribute('certificate information', json_encode($certInfo), true));
39 39
             return $result;
40 40
         }
41 41
 
42
-        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next ' . $this->expireWarningTime . ' days. Expire date: ' . $validTo . '.');
42
+        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next '.$this->expireWarningTime.' days. Expire date: '.$validTo.'.');
43 43
     }
44 44
 }
Please login to merge, or discard this patch.