Completed
Push — master ( 4b4eb0...a44523 )
by Nils
02:04
created
src/Extensions/SmokeResponseRetriever/Retriever/ListRetriever/Retriever.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                     } else {
50 50
                         $uri = new Uri($url);
51 51
                     }
52
-                    $this->urls[(string)$uri] = ['url' => $uri, 'system' => $key];
52
+                    $this->urls[(string) $uri] = ['url' => $uri, 'system' => $key];
53 53
                 }
54 54
             }
55 55
             $this->urlStack = $this->urls;
@@ -109,20 +109,20 @@  discard block
 block discarded – undo
109 109
                     if (strpos($corruptUrl, '/') === 0) {
110 110
 
111 111
                         $mainUri = $request->getUri();
112
-                        $this->redirects[(string)$mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl] = (string)$mainUri;
112
+                        $this->redirects[(string) $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl] = (string) $mainUri;
113 113
 
114
-                        $this->urls[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']];
115
-                        $this->urlStack[] = ['url' => $mainUri->getScheme() . '://' . $mainUri->getHost() . $corruptUrl, 'system' => $url['system']];
114
+                        $this->urls[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']];
115
+                        $this->urlStack[] = ['url' => $mainUri->getScheme().'://'.$mainUri->getHost().$corruptUrl, 'system' => $url['system']];
116 116
 
117 117
                         return $this->next();
118 118
                     }
119 119
 
120 120
                     // the error handling should be done withing the calling class
121
-                    echo "\n   " . $exception->getMessage() . "\n";
121
+                    echo "\n   ".$exception->getMessage()."\n";
122 122
 
123 123
                     return $this->next();
124 124
                 } else {
125
-                    $errorMessages .= $exception->getMessage() . "\n";
125
+                    $errorMessages .= $exception->getMessage()."\n";
126 126
                 }
127 127
             }
128 128
             if ($errorMessages !== '') {
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
 
140 140
     public function getOriginUri(UriInterface $uri)
141 141
     {
142
-        if (array_key_exists((string)$uri, $this->redirects)) {
143
-            return $this->urls[$this->redirects[(string)$uri]]['url'];
142
+        if (array_key_exists((string) $uri, $this->redirects)) {
143
+            return $this->urls[$this->redirects[(string) $uri]]['url'];
144 144
         }
145 145
 
146 146
         return $uri;
@@ -153,11 +153,11 @@  discard block
 block discarded – undo
153 153
 
154 154
     public function getSystem(UriInterface $uri)
155 155
     {
156
-        if (array_key_exists((string)$uri, $this->redirects)) {
157
-            return $this->urls[$this->redirects[(string)$uri]]['system'];
156
+        if (array_key_exists((string) $uri, $this->redirects)) {
157
+            return $this->urls[$this->redirects[(string) $uri]]['system'];
158 158
         }
159 159
 
160
-        return $this->urls[(string)$uri]['system'];
160
+        return $this->urls[(string) $uri]['system'];
161 161
     }
162 162
 
163 163
     public function getSystems()
Please login to merge, or discard this patch.
src/Extensions/SmokeFilter/FilterExtension.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
     public function init($filters = array(), $filterFile = '', $exclusive = array())
43 43
     {
44 44
         if (count($exclusive) > 0 && (count($filters) > 0 || $filterFile !== '')) {
45
-            throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: " . get_class($this) . '].');
45
+            throw new \RuntimeException("It's not possible to define filter lists and an exclusive list at the same time [Extension: ".get_class($this).'].');
46 46
         }
47 47
 
48 48
         if ($filterFile !== '') {
49 49
             if (!file_exists($filterFile)) {
50
-                throw new \RuntimeException('Filter file not found: ' . $filterFile);
50
+                throw new \RuntimeException('Filter file not found: '.$filterFile);
51 51
             }
52 52
 
53 53
             $filterElements = EnvAwareYaml::parse(file_get_contents($filterFile));
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 if (is_array($urls)) {
73 73
                     foreach ($urls as $url) {
74 74
                         $uri = new Uri($url);
75
-                        $this->exclusives[$rule][] = (string)$uri;
75
+                        $this->exclusives[$rule][] = (string) $uri;
76 76
                     }
77 77
                 }
78 78
             }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function isFiltered(Event $event, $ruleName, UriAwareResponse $response)
95 95
     {
96
-        $uri = (string)$this->retriever->getOriginUri($response->getUri());
96
+        $uri = (string) $this->retriever->getOriginUri($response->getUri());
97 97
 
98 98
         if ($this->currentModus === self::MODUS_FILTER) {
99 99
             $isFiltered = $this->isFilteredByFilter($ruleName, $uri);
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     private function isFilteredByFilter($ruleName, $uri)
113 113
     {
114 114
         foreach ($this->filters as $filter) {
115
-            if ($ruleName === $filter['rule'] && 0 < preg_match('$' . $filter['uri'] . '$', $uri)) {
115
+            if ($ruleName === $filter['rule'] && 0 < preg_match('$'.$filter['uri'].'$', $uri)) {
116 116
                 return true;
117 117
             }
118 118
         }
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/LeankoalaReporter.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         foreach ($this->results as $results) {
121 121
             foreach ($results as $result) {
122 122
                 /* @var CheckResult $result */
123
-                $tool = 'Smoke' . $result->getRuleName();
123
+                $tool = 'Smoke'.$result->getRuleName();
124 124
                 $checks[$tool][] = $result;
125 125
             }
126 126
         }
@@ -132,19 +132,19 @@  discard block
 block discarded – undo
132 132
                 continue;
133 133
             }
134 134
 
135
-            $message = 'The smoke test for #system_name# failed (Rule: ' . $toolName . ').<ul>';
135
+            $message = 'The smoke test for #system_name# failed (Rule: '.$toolName.').<ul>';
136 136
             $status = Event::STATUS_SUCCESS;
137 137
             $failureCount = 0;
138
-            $identifier = $toolName . '_' . $this->system;
138
+            $identifier = $toolName.'_'.$this->system;
139 139
 
140 140
             foreach ($results as $result) {
141 141
                 /** @var CheckResult $result */
142 142
                 if ($result->getStatus() === CheckResult::STATUS_FAILURE) {
143 143
                     $comingFrom = '';
144 144
                     if ($this->addComingFrom && $this->retriever->getComingFrom($result->getResponse()->getUri())) {
145
-                        $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getResponse()->getUri());
145
+                        $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getResponse()->getUri());
146 146
                     }
147
-                    $message .= '<li>' . $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . $comingFrom . ')</li>';
147
+                    $message .= '<li>'.$result->getMessage().' (url: '.(string) $result->getResponse()->getUri().$comingFrom.')</li>';
148 148
                     ++$failureCount;
149 149
                 }
150 150
             }
@@ -152,9 +152,9 @@  discard block
 block discarded – undo
152 152
                 $status = Event::STATUS_FAILURE;
153 153
                 $message .= '</ul>';
154 154
                 $firstResult = array_pop($results);
155
-                $attributes[] = new Attribute('html-content', (string)$firstResult->getResponse()->getBody(), true);
155
+                $attributes[] = new Attribute('html-content', (string) $firstResult->getResponse()->getBody(), true);
156 156
             } else {
157
-                $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:' . $toolName . '].';
157
+                $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:'.$toolName.'].';
158 158
             }
159 159
 
160 160
             $this->send($identifier, $this->system, $message, $status, $failureCount, $this->tool, $this->system, $attributes);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             foreach ($results as $result) {
168 168
                 /* @var CheckResult $result */
169 169
 
170
-                $identifier = '_' . $this->getIdentifier($result);
170
+                $identifier = '_'.$this->getIdentifier($result);
171 171
                 $tool = $this->getPrefix($result->getRuleName());
172 172
 
173 173
                 $component = $this->getComponent($result->getRuleName());
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 
176 176
                 $attributes = array();
177 177
                 if ($result->getStatus() == CheckResult::STATUS_FAILURE) {
178
-                    $body = (string)$result->getResponse()->getBody();
178
+                    $body = (string) $result->getResponse()->getBody();
179 179
                     if ($body == "") {
180 180
                         $attributes[] = new Attribute('html content', '<empty>');
181 181
                     } else {
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                 $this->send(
200 200
                     $identifier,
201 201
                     $currentSystem,
202
-                    $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . ')',
202
+                    $result->getMessage().' (url: '.(string) $result->getResponse()->getUri().')',
203 203
                     $result->getStatus(),
204 204
                     $result->getValue(),
205 205
                     $tool,
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
     private function getIdentifier(CheckResult $result)
214 214
     {
215
-        return $this->tool . '_' . $result->getRuleName();
215
+        return $this->tool.'_'.$result->getRuleName();
216 216
     }
217 217
 
218 218
     private function getPrefix($string)
Please login to merge, or discard this patch.
src/Rules/Html/RegExExistsRule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
             if ($regEx['isRegEx']) {
43 43
                 $pattern = str_replace('', '\\~', $regEx['pattern']);
44 44
 
45
-                if (preg_match('~' . $pattern . '~', (string)$response->getBody()) === 0) {
46
-                    $errors[] = 'Regular expression: ' . $regEx['pattern'];
45
+                if (preg_match('~'.$pattern.'~', (string) $response->getBody()) === 0) {
46
+                    $errors[] = 'Regular expression: '.$regEx['pattern'];
47 47
                 }
48 48
             } else {
49
-                if (preg_match('^' . preg_quote($regEx['pattern']) . '^', (string)$response->getBody()) === 0) {
50
-                    $errors[] = 'Text: ' . $regEx['pattern'];
49
+                if (preg_match('^'.preg_quote($regEx['pattern']).'^', (string) $response->getBody()) === 0) {
50
+                    $errors[] = 'Text: '.$regEx['pattern'];
51 51
                 }
52 52
             }
53 53
         }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             $errorString = 'The following text elements were not found: <ul>';
57 57
 
58 58
             foreach ($errors as $error) {
59
-                $errorString .= '<li>' . $error . '</li>';
59
+                $errorString .= '<li>'.$error.'</li>';
60 60
             }
61 61
 
62 62
             $errorString .= '</ul>';
Please login to merge, or discard this patch.
src/Rules/Html/ClosingHtmlTagRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
     {
17 17
         if ($response instanceof ContentTypeAwareResponse) {
18 18
             if (($response->getStatusCode() < 300 || $response->getStatusCode() >= 400) && $response->getContentType() === 'text/html') {
19
-                if (stripos((string)$response->getBody(), '</html>') === false) {
20
-                    throw new ValidationFailedException('Closing html tag is missing (document length: ' . strlen((string)$response->getBody()) . ').');
19
+                if (stripos((string) $response->getBody(), '</html>') === false) {
20
+                    throw new ValidationFailedException('Closing html tag is missing (document length: '.strlen((string) $response->getBody()).').');
21 21
                 }
22 22
             }
23 23
         }
Please login to merge, or discard this patch.