@@ -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) |
@@ -182,6 +182,11 @@ |
||
| 182 | 182 | return substr($string, 0, strpos($string, '_')); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $identifier |
|
| 187 | + * @param string $message |
|
| 188 | + * @param string $tool |
|
| 189 | + */ |
|
| 185 | 190 | private function send($identifier, $system, $message, $status, $value, $tool, $component) |
| 186 | 191 | { |
| 187 | 192 | if ($status !== CheckResult::STATUS_NONE) { |
@@ -34,15 +34,15 @@ |
||
| 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 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | { |
| 35 | 35 | $data = json_decode($response->getBody()); |
| 36 | 36 | if ($data === null) { |
| 37 | - throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "')."); |
|
| 37 | + throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."')."); |
|
| 38 | 38 | } else { |
| 39 | 39 | $error = false; |
| 40 | 40 | $messageParts = array(); |
@@ -50,14 +50,14 @@ discard block |
||
| 50 | 50 | $error = true; |
| 51 | 51 | $errorMessage = ''; |
| 52 | 52 | foreach ($validator->getErrors() as $error) { |
| 53 | - $errorMessage = $errorMessage . sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
| 53 | + $errorMessage = $errorMessage.sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
| 54 | 54 | } |
| 55 | - $messageParts[] = $jsonSchemaFile['jsonfilename'] . ' - ' . $jsonSchemaFile['jsonfileurl'] . '(last error: ' . $errorMessage . ').'; |
|
| 55 | + $messageParts[] = $jsonSchemaFile['jsonfilename'].' - '.$jsonSchemaFile['jsonfileurl'].'(last error: '.$errorMessage.').'; |
|
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | if ($error === true) { |
| 60 | - $message = 'JSON file (' . (string) $response->getUri() . ') does not validate against the following JSON Schema files: ' . implode(', ', $messageParts); |
|
| 60 | + $message = 'JSON file ('.(string) $response->getUri().') does not validate against the following JSON Schema files: '.implode(', ', $messageParts); |
|
| 61 | 61 | throw new ValidationFailedException($message); |
| 62 | 62 | } |
| 63 | 63 | } |
@@ -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 | } |