@@ -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); |
@@ -22,14 +22,14 @@ |
||
22 | 22 | if (count($results) > 0) { |
23 | 23 | ++$this->urlCount; |
24 | 24 | $firstResult = array_pop($results); |
25 | - $this->output->writeln(' ' . (string) $firstResult->getResponse()->getUri()); |
|
25 | + $this->output->writeln(' '.(string) $firstResult->getResponse()->getUri()); |
|
26 | 26 | $this->output->writeln(''); |
27 | 27 | } |
28 | 28 | } |
29 | 29 | |
30 | 30 | public function finish() |
31 | 31 | { |
32 | - $this->output->writeln(' <comment>Warm up finished. ' . $this->urlCount . ' urls visited.</comment>'); |
|
32 | + $this->output->writeln(' <comment>Warm up finished. '.$this->urlCount.' urls visited.</comment>'); |
|
33 | 33 | $this->output->writeln(''); |
34 | 34 | } |
35 | 35 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | } catch (ValidationFailedException $e) { |
97 | 97 | $result = new CheckResult(CheckResult::STATUS_FAILURE, $e->getMessage()); |
98 | 98 | } catch (\Exception $e) { |
99 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: ' . $e->getMessage()); |
|
99 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: '.$e->getMessage()); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $result->setResponse($response); |
@@ -198,12 +198,12 @@ |
||
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
201 | - * @param $identifier |
|
201 | + * @param string $identifier |
|
202 | 202 | * @param $system |
203 | - * @param $message |
|
203 | + * @param string $message |
|
204 | 204 | * @param $status |
205 | 205 | * @param $value |
206 | - * @param $tool |
|
206 | + * @param string $tool |
|
207 | 207 | * @param $component |
208 | 208 | * @param Attribute[] $attributes |
209 | 209 | */ |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | foreach ($this->results as $results) { |
125 | 125 | foreach ($results as $result) { |
126 | 126 | /* @var CheckResult $result */ |
127 | - $tool = 'Smoke' . $result->getRuleName(); |
|
127 | + $tool = 'Smoke'.$result->getRuleName(); |
|
128 | 128 | $checks[$tool][] = $result; |
129 | 129 | } |
130 | 130 | } |
@@ -136,19 +136,19 @@ discard block |
||
136 | 136 | continue; |
137 | 137 | } |
138 | 138 | |
139 | - $message = 'The smoke test for #system_name# failed (Rule: ' . $toolName . ').<ul>'; |
|
139 | + $message = 'The smoke test for #system_name# failed (Rule: '.$toolName.').<ul>'; |
|
140 | 140 | $status = Event::STATUS_SUCCESS; |
141 | 141 | $failureCount = 0; |
142 | - $identifier = $toolName . '_' . $this->system; |
|
142 | + $identifier = $toolName.'_'.$this->system; |
|
143 | 143 | |
144 | 144 | foreach ($results as $result) { |
145 | 145 | /** @var CheckResult $result */ |
146 | 146 | if ($result->getStatus() === CheckResult::STATUS_FAILURE) { |
147 | 147 | $comingFrom = ''; |
148 | 148 | if ($this->addComingFrom && $this->retriever->getComingFrom($result->getResponse()->getUri())) { |
149 | - $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getResponse()->getUri()); |
|
149 | + $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getResponse()->getUri()); |
|
150 | 150 | } |
151 | - $message .= '<li>' . $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . $comingFrom . ')</li>'; |
|
151 | + $message .= '<li>'.$result->getMessage().' (url: '.(string) $result->getResponse()->getUri().$comingFrom.')</li>'; |
|
152 | 152 | ++$failureCount; |
153 | 153 | } |
154 | 154 | } |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | $status = Event::STATUS_FAILURE; |
157 | 157 | $message .= '</ul>'; |
158 | 158 | $firstResult = array_pop($results); |
159 | - $attributes[] = new Attribute('html-content', (string)$firstResult->getResponse()->getBody(), true); |
|
159 | + $attributes[] = new Attribute('html-content', (string) $firstResult->getResponse()->getBody(), true); |
|
160 | 160 | } else { |
161 | - $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:' . $toolName . '].'; |
|
161 | + $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:'.$toolName.'].'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | $this->send($identifier, $this->system, $message, $status, $failureCount, $this->tool, $this->system, $attributes); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | foreach ($results as $result) { |
172 | 172 | /* @var CheckResult $result */ |
173 | 173 | |
174 | - $identifier = '_' . $this->getIdentifier($result); |
|
174 | + $identifier = '_'.$this->getIdentifier($result); |
|
175 | 175 | $tool = $this->getPrefix($result->getRuleName()); |
176 | 176 | |
177 | 177 | $component = $this->getComponent($result->getRuleName()); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $attributes = array(); |
181 | 181 | if ($result->getStatus() == CheckResult::STATUS_FAILURE) { |
182 | - $body = (string)$result->getResponse()->getBody(); |
|
182 | + $body = (string) $result->getResponse()->getBody(); |
|
183 | 183 | if ($body == "") { |
184 | 184 | $attributes[] = new Attribute('html content', '<empty>'); |
185 | 185 | } else { |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | $this->send( |
204 | 204 | $identifier, |
205 | 205 | $currentSystem, |
206 | - $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . ')', |
|
206 | + $result->getMessage().' (url: '.(string) $result->getResponse()->getUri().')', |
|
207 | 207 | $result->getStatus(), |
208 | 208 | $result->getValue(), |
209 | 209 | $tool, |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | |
217 | 217 | private function getIdentifier(CheckResult $result) |
218 | 218 | { |
219 | - return $this->tool . '_' . $result->getRuleName(); |
|
219 | + return $this->tool.'_'.$result->getRuleName(); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | private function getPrefix($string) |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | $this->reporter->sendEvent($event); |
248 | 248 | } catch (KoalamonException $e) { |
249 | 249 | $this->output->writeln("\n <error> Error sending result to leankoala. </error>"); |
250 | - $this->output->writeln(' Url: ' . $e->getUrl()); |
|
251 | - $this->output->writeln(' Payload: ' . $e->getPayload()); |
|
250 | + $this->output->writeln(' Url: '.$e->getUrl()); |
|
251 | + $this->output->writeln(' Payload: '.$e->getPayload()); |
|
252 | 252 | $this->output->writeln(""); |
253 | 253 | } catch (\Exception $e) { |
254 | 254 | $this->output->writeln($e->getMessage()); |
@@ -24,13 +24,13 @@ |
||
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 | } |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Psr\Http\Message\ResponseInterface; |
6 | 6 | use whm\Html\Document; |
7 | -use whm\Smoke\Http\Response; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * This rules counts the css files that are included in a document. If the number is higher |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Psr\Http\Message\ResponseInterface; |
6 | 6 | use whm\Html\Document; |
7 | -use whm\Smoke\Http\Response; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * This rules counts the js files that are included in a document. If the number is higher |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace whm\Smoke\Rules\Http; |
4 | 4 | |
5 | 5 | use Psr\Http\Message\ResponseInterface; |
6 | -use whm\Smoke\Http\Response; |
|
7 | 6 | use whm\Smoke\Rules\Rule; |
8 | 7 | |
9 | 8 | abstract class HttpsRule implements Rule |
@@ -24,7 +24,7 @@ |
||
24 | 24 | $sslOptions = stream_context_create(array('ssl' => array('capture_peer_cert' => true))); |
25 | 25 | |
26 | 26 | $request = @stream_socket_client( |
27 | - 'ssl://' . $host . ':443', |
|
27 | + 'ssl://'.$host.':443', |
|
28 | 28 | $errno, |
29 | 29 | $errstr, |
30 | 30 | 30, |