@@ -73,17 +73,17 @@ |
||
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 | 78 | if ($this->checkRelation($path['relation'], $path['value'], $count) === false) { |
79 | 79 | $error = true; |
80 | - $noCorrectJsonPaths[] = $path['pattern'] . ' (number of JSONPaths is not correct corresponding to the given relation/value)'; |
|
80 | + $noCorrectJsonPaths[] = $path['pattern'].' (number of JSONPaths is not correct corresponding to the given relation/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 | } |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | |
30 | 30 | foreach ($this->regExs as $regEx) { |
31 | 31 | if ($regEx['isRegEx']) { |
32 | - if (preg_match('^' . $regEx['pattern'] . '^', (string) $response->getBody()) === 0) { |
|
33 | - $errors[] = 'Regular expression: ' . $regEx['pattern']; |
|
32 | + if (preg_match('^'.$regEx['pattern'].'^', (string) $response->getBody()) === 0) { |
|
33 | + $errors[] = 'Regular expression: '.$regEx['pattern']; |
|
34 | 34 | } |
35 | 35 | } else { |
36 | - if (preg_match('^' . preg_quote($regEx['pattern']) . '^', (string) $response->getBody()) === 0) { |
|
37 | - $errors[] = 'Text: ' . $regEx['pattern']; |
|
36 | + if (preg_match('^'.preg_quote($regEx['pattern']).'^', (string) $response->getBody()) === 0) { |
|
37 | + $errors[] = 'Text: '.$regEx['pattern']; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $errorString = 'The following text elements were not found: <ul>'; |
44 | 44 | |
45 | 45 | foreach ($errors as $error) { |
46 | - $errorString .= '<li>' . $error . '</li>'; |
|
46 | + $errorString .= '<li>'.$error.'</li>'; |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | $errorString .= '</ul>'; |
@@ -31,15 +31,15 @@ |
||
31 | 31 | |
32 | 32 | if ($xpath['relation'] === 'equals') { |
33 | 33 | $result = $count === (int) $xpath['value']; |
34 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were exact ' . $xpath['value'] . ' occurencies.'; |
|
34 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were exact '.$xpath['value'].' occurencies.'; |
|
35 | 35 | } elseif ($xpath['relation'] === 'less than') { |
36 | 36 | $result = $count < (int) $xpath['value']; |
37 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were less than ' . $xpath['value'] . '.'; |
|
37 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were less than '.$xpath['value'].'.'; |
|
38 | 38 | } elseif ($xpath['relation'] === 'greater than') { |
39 | 39 | $result = $count > (int) $xpath['value']; |
40 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were more than ' . $xpath['value'] . '.'; |
|
40 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were more than '.$xpath['value'].'.'; |
|
41 | 41 | } else { |
42 | - throw new \RuntimeException('Relation not defined. Given "' . $xpath['relation'] . '" expected [equals, greater than, less than]'); |
|
42 | + throw new \RuntimeException('Relation not defined. Given "'.$xpath['relation'].'" expected [equals, greater than, less than]'); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | $this->assert($result, $message); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | private function getEndpoint(Uri $uri) |
16 | 16 | { |
17 | 17 | // return str_replace('#url#', urlencode('https://webhook.koalamon.com'), self::ENDPOINT); |
18 | - return str_replace('#url#', urlencode((string)$uri), self::ENDPOINT); |
|
18 | + return str_replace('#url#', urlencode((string) $uri), self::ENDPOINT); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function validate(Response $response) |
@@ -34,15 +34,15 @@ discard block |
||
34 | 34 | ))); |
35 | 35 | |
36 | 36 | if (property_exists($result, 'error')) { |
37 | - throw new ValidationFailedException('Google mobile friendly test was not passed. Error "' . $result->error->message . '"'); |
|
37 | + throw new ValidationFailedException('Google mobile friendly test was not passed. Error "'.$result->error->message.'"'); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | $passResult = $result->ruleGroups->USABILITY; |
41 | 41 | |
42 | 42 | if (!$passResult->pass) { |
43 | - return new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Score ' . $passResult->score . '/100.', (int)$passResult->score); |
|
43 | + return new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Score '.$passResult->score.'/100.', (int) $passResult->score); |
|
44 | 44 | } |
45 | 45 | |
46 | - return new CheckResult(CheckResult::STATUS_SUCCESS, 'Google mobile friendly test passed. Score ' . $passResult->score . '/100.', (int)$passResult->score); |
|
46 | + return new CheckResult(CheckResult::STATUS_SUCCESS, 'Google mobile friendly test passed. Score '.$passResult->score.'/100.', (int) $passResult->score); |
|
47 | 47 | } |
48 | 48 | } |
@@ -23,10 +23,10 @@ |
||
23 | 23 | { |
24 | 24 | if (array_key_exists('issuer', $certInfo) and array_key_exists('CN', $certInfo['issuer'])) { |
25 | 25 | if ($certInfo['issuer']['CN'] !== $this->authorityName) { |
26 | - throw new ValidationFailedException('Expected authority was "' . $this->authorityName . '", "' . $certInfo['issuer']['CN'] . '" found.'); |
|
26 | + throw new ValidationFailedException('Expected authority was "'.$this->authorityName.'", "'.$certInfo['issuer']['CN'].'" found.'); |
|
27 | 27 | } |
28 | 28 | } else { |
29 | - throw new ValidationFailedException('Expected authority was "' . $this->authorityName . '". No authority found.'); |
|
29 | + throw new ValidationFailedException('Expected authority was "'.$this->authorityName.'". No authority found.'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -12,10 +12,10 @@ |
||
12 | 12 | |
13 | 13 | foreach ($matches[1] as $varName) { |
14 | 14 | if (!getenv($varName)) { |
15 | - throw new \RuntimeException('The mandatory env variable (' . $varName . ') from the config file was not set.'); |
|
15 | + throw new \RuntimeException('The mandatory env variable ('.$varName.') from the config file was not set.'); |
|
16 | 16 | } |
17 | 17 | |
18 | - $fileContent = str_replace('${' . $varName . '}', getenv($varName), $fileContent); |
|
18 | + $fileContent = str_replace('${'.$varName.'}', getenv($varName), $fileContent); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | return Yaml::parse($fileContent); |
@@ -27,13 +27,13 @@ |
||
27 | 27 | if ($response->getDuration() > $this->maxDuration) { |
28 | 28 | return new CheckResult( |
29 | 29 | CheckResult::STATUS_FAILURE, |
30 | - 'The http request took ' . (int) $response->getDuration() . ' milliseconds (limit was ' . $this->maxDuration . 'ms).', |
|
30 | + 'The http request took '.(int) $response->getDuration().' milliseconds (limit was '.$this->maxDuration.'ms).', |
|
31 | 31 | (int) $response->getDuration()); |
32 | 32 | } |
33 | 33 | |
34 | 34 | return new CheckResult( |
35 | 35 | CheckResult::STATUS_SUCCESS, |
36 | - 'The http request took ' . (int) $response->getDuration() . ' milliseconds.', |
|
36 | + 'The http request took '.(int) $response->getDuration().' milliseconds.', |
|
37 | 37 | (int) $response->getDuration()); |
38 | 38 | } |
39 | 39 | } |
@@ -25,13 +25,13 @@ |
||
25 | 25 | $validTo = date('d.m.Y H:i:s', $certInfo['validTo_time_t']); |
26 | 26 | |
27 | 27 | if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) { |
28 | - $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']'; |
|
28 | + $errorMessage = 'Certificate is expired. ['.$validFrom.' - '.$validTo.']'; |
|
29 | 29 | return new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage); |
30 | - } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) { |
|
31 | - $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo; |
|
30 | + } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) { |
|
31 | + $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo; |
|
32 | 32 | return new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage, 0); |
33 | 33 | } |
34 | 34 | |
35 | - return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next ' . $this->expireWarningTime . ' days. Expire date: ' . $validTo . '.'); |
|
35 | + return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next '.$this->expireWarningTime.' days. Expire date: '.$validTo.'.'); |
|
36 | 36 | } |
37 | 37 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | foreach ($this->results as $results) { |
111 | 111 | foreach ($results as $result) { |
112 | 112 | /* @var CheckResult $result */ |
113 | - $tool = 'Smoke' . $result->getRuleName(); |
|
113 | + $tool = 'Smoke'.$result->getRuleName(); |
|
114 | 114 | $checks[$tool][] = $result; |
115 | 115 | } |
116 | 116 | } |
@@ -120,19 +120,19 @@ discard block |
||
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
123 | - $message = 'The smoke test for #system_name# failed (Rule: ' . $toolName . ').<ul>'; |
|
123 | + $message = 'The smoke test for #system_name# failed (Rule: '.$toolName.').<ul>'; |
|
124 | 124 | $status = Event::STATUS_SUCCESS; |
125 | 125 | $failureCount = 0; |
126 | - $identifier = $toolName . '_' . $this->system; |
|
126 | + $identifier = $toolName.'_'.$this->system; |
|
127 | 127 | |
128 | 128 | foreach ($results as $result) { |
129 | 129 | /** @var CheckResult $result */ |
130 | 130 | if ($result->getStatus() === CheckResult::STATUS_FAILURE) { |
131 | 131 | $comingFrom = ''; |
132 | 132 | if ($this->addComingFrom && $this->retriever->getComingFrom($result->getResponse()->getUri())) { |
133 | - $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getResponse()->getUri()); |
|
133 | + $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getResponse()->getUri()); |
|
134 | 134 | } |
135 | - $message .= '<li>' . $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . $comingFrom . ')</li>'; |
|
135 | + $message .= '<li>'.$result->getMessage().' (url: '.(string) $result->getResponse()->getUri().$comingFrom.')</li>'; |
|
136 | 136 | ++$failureCount; |
137 | 137 | } |
138 | 138 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $status = Event::STATUS_FAILURE; |
141 | 141 | $message .= '</ul>'; |
142 | 142 | } else { |
143 | - $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:' . $toolName . '].'; |
|
143 | + $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:'.$toolName.'].'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | $this->send($identifier, $this->system, $message, $status, $failureCount, $this->tool, $this->system); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | foreach ($results as $result) { |
154 | 154 | /* @var CheckResult $result */ |
155 | 155 | |
156 | - $identifier = '_' . $this->getIdentifier($result); |
|
156 | + $identifier = '_'.$this->getIdentifier($result); |
|
157 | 157 | $tool = $this->getPrefix($result->getRuleName()); |
158 | 158 | |
159 | 159 | $component = $this->getComponent($result->getRuleName()); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $this->send( |
163 | 163 | $identifier, |
164 | 164 | $system, |
165 | - $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . ')', |
|
165 | + $result->getMessage().' (url: '.(string) $result->getResponse()->getUri().')', |
|
166 | 166 | $result->getStatus(), |
167 | 167 | $result->getValue(), |
168 | 168 | $tool, |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | |
175 | 175 | private function getIdentifier(CheckResult $result) |
176 | 176 | { |
177 | - return $this->tool . '_' . $result->getRuleName(); |
|
177 | + return $this->tool.'_'.$result->getRuleName(); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | private function getPrefix($string) |