Completed
Push — master ( a44523...85e5eb )
by Nils
01:57
created
src/Extensions/SmokeReporter/Reporter/LeankoalaReporter.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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());
Please login to merge, or discard this patch.