@@ -25,8 +25,8 @@ |
||
25 | 25 | protected function doValidation(Response $response) |
26 | 26 | { |
27 | 27 | foreach ($this->regExs as $regEx) { |
28 | - $this->assert(preg_match('^' . $regEx . '^', (string) $response->getBody()) > 0, |
|
29 | - 'The given regular expression (' . $regEx . ') was not found in this document.'); |
|
28 | + $this->assert(preg_match('^'.$regEx.'^', (string) $response->getBody()) > 0, |
|
29 | + 'The given regular expression ('.$regEx.') was not found in this document.'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -26,10 +26,10 @@ |
||
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 | throw new ValidationFailedException($errorMessage); |
31 | - } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) { |
|
32 | - $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo; |
|
31 | + } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) { |
|
32 | + $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo; |
|
33 | 33 | throw new ValidationFailedException($errorMessage); |
34 | 34 | } |
35 | 35 |
@@ -29,7 +29,7 @@ |
||
29 | 29 | $sslOptions = stream_context_create(array('ssl' => array('capture_peer_cert' => true))); |
30 | 30 | |
31 | 31 | $request = stream_socket_client( |
32 | - 'ssl://' . $host . ':443', |
|
32 | + 'ssl://'.$host.':443', |
|
33 | 33 | $errno, |
34 | 34 | $errstr, |
35 | 35 | 30, |
@@ -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 | } |
@@ -25,8 +25,8 @@ |
||
25 | 25 | protected function doValidation(Response $response) |
26 | 26 | { |
27 | 27 | foreach ($this->regExs as $regEx) { |
28 | - $this->assert(preg_match('^' . $regEx . '^', (string) $response->getBody()) === 0, |
|
29 | - 'The given regular expression (' . $regEx . ') was found in this document.'); |
|
28 | + $this->assert(preg_match('^'.$regEx.'^', (string) $response->getBody()) === 0, |
|
29 | + 'The given regular expression ('.$regEx.') was found in this document.'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | public function finish() |
94 | 94 | { |
95 | - $this->output->writeln('Sending results to ' . $this->server . " ... \n"); |
|
95 | + $this->output->writeln('Sending results to '.$this->server." ... \n"); |
|
96 | 96 | |
97 | 97 | if ($this->groupBy === 'prefix') { |
98 | 98 | $this->sendGroupedByPrefix(); |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | foreach ($this->getRuleKeys() as $rule) { |
125 | 125 | foreach ($systems as $system) { |
126 | - $identifier = $this->tool . '_' . $this->getPrefix($rule) . '_' . $system; |
|
126 | + $identifier = $this->tool.'_'.$this->getPrefix($rule).'_'.$system; |
|
127 | 127 | $failureMessages[$identifier]['message'] = ''; |
128 | 128 | $failureMessages[$identifier]['system'] = $system; |
129 | 129 | $failureMessages[$identifier]['tool'] = $this->getPrefix($rule); |
@@ -140,22 +140,22 @@ discard block |
||
140 | 140 | $system = $this->retriever->getSystem(($result->getUrl())); |
141 | 141 | } |
142 | 142 | |
143 | - $identifer = $this->tool . '_' . $this->getPrefix($ruleLKey) . '_' . $system; |
|
143 | + $identifer = $this->tool.'_'.$this->getPrefix($ruleLKey).'_'.$system; |
|
144 | 144 | |
145 | 145 | if ($failureMessages[$identifer]['message'] === '') { |
146 | - $failureMessages[$identifer]['message'] = 'The ' . $this->getPrefix($ruleLKey) . ' test for #system_name# failed.<ul>'; |
|
146 | + $failureMessages[$identifer]['message'] = 'The '.$this->getPrefix($ruleLKey).' test for #system_name# failed.<ul>'; |
|
147 | 147 | } |
148 | 148 | ++$counter[$identifer]; |
149 | - $failureMessages[$identifer]['message'] .= '<li>' . $message . '<br>url: ' . $result->getUrl() . ', coming from: ' . $this->retriever->getComingFrom($result->getUrl()) . '</li>'; |
|
149 | + $failureMessages[$identifer]['message'] .= '<li>'.$message.'<br>url: '.$result->getUrl().', coming from: '.$this->retriever->getComingFrom($result->getUrl()).'</li>'; |
|
150 | 150 | } |
151 | 151 | } |
152 | 152 | } |
153 | 153 | |
154 | 154 | foreach ($failureMessages as $key => $failureMessage) { |
155 | 155 | if ($failureMessage['message'] !== '') { |
156 | - $this->send($this->identifier . '_' . $key, $failureMessage['system'], $failureMessage['message'] . '</ul>', self::STATUS_FAILURE, '', $counter[$key], $failureMessage['tool']); |
|
156 | + $this->send($this->identifier.'_'.$key, $failureMessage['system'], $failureMessage['message'].'</ul>', self::STATUS_FAILURE, '', $counter[$key], $failureMessage['tool']); |
|
157 | 157 | } else { |
158 | - $this->send($this->identifier . '_' . $key, $failureMessage['system'], '', self::STATUS_SUCCESS, '', 0, $failureMessage['tool']); |
|
158 | + $this->send($this->identifier.'_'.$key, $failureMessage['system'], '', self::STATUS_SUCCESS, '', 0, $failureMessage['tool']); |
|
159 | 159 | } |
160 | 160 | } |
161 | 161 | } |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $failedTests = array(); |
168 | 168 | if ($result->isFailure()) { |
169 | 169 | foreach ($result->getMessages() as $ruleLKey => $message) { |
170 | - $identifier = 'smoke_' . $ruleLKey . '_' . $result->getUrl(); |
|
170 | + $identifier = 'smoke_'.$ruleLKey.'_'.$result->getUrl(); |
|
171 | 171 | |
172 | 172 | if ($this->system === '') { |
173 | 173 | $system = str_replace('http://', '', $result->getUrl()); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } |
181 | 181 | foreach ($rules as $rule) { |
182 | 182 | if (!in_array($rule, $failedTests, true)) { |
183 | - $identifier = 'smoke_' . $rule . '_' . $result->getUrl(); |
|
183 | + $identifier = 'smoke_'.$rule.'_'.$result->getUrl(); |
|
184 | 184 | |
185 | 185 | if ($this->systemUseRetriever) { |
186 | 186 | $system = $this->retriever->getSystem($result->getUrl()); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } else { |
190 | 190 | $system = $this->system; |
191 | 191 | } |
192 | - $this->send($identifier, $system, 'smoke_' . $rule . '_' . $result->getUrl(), self::STATUS_SUCCESS, (string) $result->getUrl()); |
|
192 | + $this->send($identifier, $system, 'smoke_'.$rule.'_'.$result->getUrl(), self::STATUS_SUCCESS, (string) $result->getUrl()); |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | } |
@@ -213,16 +213,16 @@ discard block |
||
213 | 213 | $system = $this->retriever->getSystem(new Uri($result->getUrl())); |
214 | 214 | } |
215 | 215 | if ($failureMessages[$ruleLKey] === '') { |
216 | - $failureMessages[$ruleLKey]['message'] = ' The smoke test for #system_name# failed (Rule: ' . $ruleLKey . ').<ul>'; |
|
216 | + $failureMessages[$ruleLKey]['message'] = ' The smoke test for #system_name# failed (Rule: '.$ruleLKey.').<ul>'; |
|
217 | 217 | } |
218 | 218 | ++$counter[$ruleLKey]; |
219 | 219 | |
220 | 220 | $comingFrom = ''; |
221 | 221 | if ($this->retriever->getComingFrom($result->getUrl())) { |
222 | - $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getUrl()); |
|
222 | + $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getUrl()); |
|
223 | 223 | } |
224 | 224 | |
225 | - $failureMessages[$ruleLKey]['message'] .= '<li>' . $message . ' (url: ' . $result->getUrl() . $comingFrom . ')</li > '; |
|
225 | + $failureMessages[$ruleLKey]['message'] .= '<li>'.$message.' (url: '.$result->getUrl().$comingFrom.')</li > '; |
|
226 | 226 | $failureMessages[$ruleLKey]['system'] = $system; |
227 | 227 | } |
228 | 228 | } |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | |
231 | 231 | foreach ($failureMessages as $key => $failureMessage) { |
232 | 232 | if ($failureMessage !== '') { |
233 | - $this->send($this->identifier . '_' . $key, $this->system, $failureMessage['message'] . ' </ul > ', self::STATUS_FAILURE, '', $counter[$key]); |
|
233 | + $this->send($this->identifier.'_'.$key, $this->system, $failureMessage['message'].' </ul > ', self::STATUS_FAILURE, '', $counter[$key]); |
|
234 | 234 | } else { |
235 | - $this->send($this->identifier . '_' . $key, $this->system, '', self::STATUS_SUCCESS, '', 0); |
|
235 | + $this->send($this->identifier.'_'.$key, $this->system, '', self::STATUS_SUCCESS, '', 0); |
|
236 | 236 | } |
237 | 237 | } |
238 | 238 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function doValidation(Response $response) |
23 | 23 | { |
24 | 24 | $domDocument = new \DOMDocument(); |
25 | - @$domDocument->loadHTML((string)$response->getBody()); |
|
25 | + @$domDocument->loadHTML((string) $response->getBody()); |
|
26 | 26 | |
27 | 27 | $domXPath = new \DOMXPath($domDocument); |
28 | 28 | |
@@ -30,16 +30,16 @@ discard block |
||
30 | 30 | $count = $domXPath->query($xpath['pattern'])->length; |
31 | 31 | |
32 | 32 | if ($xpath['relation'] === 'equals') { |
33 | - $result = $count == (int)$xpath['value']; |
|
34 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were exact ' . $xpath['value'] . ' occurencies.'; |
|
33 | + $result = $count == (int) $xpath['value']; |
|
34 | + $message = 'The xpath "'.$xpath['pattern'].'" was found '.$count.' times. Expected were exact '.$xpath['value'].' occurencies.'; |
|
35 | 35 | } elseif ($xpath['relation'] === 'less than') { |
36 | - $result = $count < (int)$xpath['value']; |
|
37 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were less than ' . $xpath['value'] . '.'; |
|
36 | + $result = $count < (int) $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 | - $result = $count > (int)$xpath['value']; |
|
40 | - $message = 'The xpath "' . $xpath['pattern'] . '" was found ' . $count . ' times. Expected were more than ' . $xpath['value'] . '.'; |
|
39 | + $result = $count > (int) $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); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | { |
17 | 17 | if (strpos($response->getContentType(), 'image') === false |
18 | 18 | && strpos($response->getContentType(), 'pdf') === false |
19 | - && (string)$response->getBody() != '' |
|
19 | + && (string) $response->getBody() != '' |
|
20 | 20 | ) { |
21 | 21 | if (!$response->hasHeader('Content-Encoding') || $response->getHeader('Content-Encoding')[0] !== 'gzip') { |
22 | 22 | throw new ValidationFailedException('gzip compression not active'); |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | public function init($filters = array(), $filterFile = '', $exclusive = array()) |
42 | 42 | { |
43 | 43 | if (count($exclusive) > 0 && (count($filters) > 0 || $filterFile !== '')) { |
44 | - throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: " . get_class($this) . '].'); |
|
44 | + throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: ".get_class($this).'].'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | if ($filterFile !== '') { |
48 | 48 | if (!file_exists($filterFile)) { |
49 | - throw new \RuntimeException('Filter file not found: ' . $filterFile); |
|
49 | + throw new \RuntimeException('Filter file not found: '.$filterFile); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | $filterElements = EnvAwareYaml::parse(file_get_contents($filterFile)); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function isFiltered(Event $event, $ruleName, Response $response) |
87 | 87 | { |
88 | - $uri = (string)$this->retriever->getOriginUri($response->getUri()); |
|
88 | + $uri = (string) $this->retriever->getOriginUri($response->getUri()); |
|
89 | 89 | |
90 | 90 | if ($this->currentModus === self::MODUS_FILTER) { |
91 | 91 | $isFiltered = $this->isFilteredByFilter($ruleName, $uri); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | private function isFilteredByFilter($ruleName, $uri) |
106 | 106 | { |
107 | 107 | foreach ($this->filters as $filter) { |
108 | - if ($ruleName === $filter['rule'] && 0 < preg_match('$' . $filter['uri'] . '$', $uri)) { |
|
108 | + if ($ruleName === $filter['rule'] && 0 < preg_match('$'.$filter['uri'].'$', $uri)) { |
|
109 | 109 | return true; |
110 | 110 | } |
111 | 111 | } |