Completed
Push — master ( ef1f9a...fdc95c )
by
unknown
02:05
created
src/Rules/Http/HttpsCertificateAuthorityRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,10 +23,10 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Yaml/EnvAwareYaml.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/WarmUpLiveReporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
src/Scanner/Scanner.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/LeankoalaReporter.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -198,12 +198,12 @@
 block discarded – undo
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
      */
Please login to merge, or discard this 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.
src/Rules/Http/Header/ExistsRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,13 +24,13 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Rules/Html/CssFileCountRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Rules/Html/JsFileCountRule.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Rules/Http/HttpsRule.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.