Completed
Push — master ( 56f171...d3eeb5 )
by Nils
01:53
created
src/Rules/Http/HttpsCertificateExpireRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         } else {
32 32
 
33 33
             if ($certInfo['validFrom_time_t'] > time() || $certInfo['validTo_time_t'] < time()) {
34
-                $errorMessage = 'Certificate is expired. [' . $validFrom . ' - ' . $validTo . ']';
34
+                $errorMessage = 'Certificate is expired. ['.$validFrom.' - '.$validTo.']';
35 35
 
36 36
                 $result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage);
37 37
                 $infoJson = json_encode($certInfo);
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
                     $result->addAttribute(new Attribute('certificate information', $infoJson, true));
42 42
                 }
43 43
                 return $result;
44
-            } elseif ($certInfo['validTo_time_t'] < strtotime('+' . $this->expireWarningTime . 'days')) {
45
-                $errorMessage = 'Certificate warning, expires in less than ' . $this->expireWarningTime . ' days. Certificate expires at: ' . $validTo;
44
+            } elseif ($certInfo['validTo_time_t'] < strtotime('+'.$this->expireWarningTime.'days')) {
45
+                $errorMessage = 'Certificate warning, expires in less than '.$this->expireWarningTime.' days. Certificate expires at: '.$validTo;
46 46
 
47 47
                 $result = new CheckResult(CheckResult::STATUS_FAILURE, $errorMessage);
48 48
                 $result->addAttribute(new Attribute('certificate information', json_encode($certInfo), true));
@@ -50,6 +50,6 @@  discard block
 block discarded – undo
50 50
             }
51 51
         }
52 52
 
53
-        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next ' . $this->expireWarningTime . ' days. Expire date: ' . $validTo . '.');
53
+        return new CheckResult(CheckResult::STATUS_SUCCESS, 'The certificate does not expire within the next '.$this->expireWarningTime.' days. Expire date: '.$validTo.'.');
54 54
     }
55 55
 }
Please login to merge, or discard this patch.
src/Rules/Http/HttpsRule.php 1 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.
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
-                    $attributes[] = new Attribute('html content', (string)$result->getResponse()->getBody(), true);
178
+                    $attributes[] = new Attribute('html content', (string) $result->getResponse()->getBody(), true);
179 179
                     $attributes[] = new Attribute('http header', json_encode($result->getResponse()->getHeaders()), true);
180 180
                     $attributes[] = new Attribute('http status code', $result->getResponse()->getStatusCode());
181 181
                 }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
                 $this->send(
195 195
                     $identifier,
196 196
                     $currentSystem,
197
-                    $result->getMessage() . ' (url: ' . (string)$result->getResponse()->getUri() . ')',
197
+                    $result->getMessage().' (url: '.(string) $result->getResponse()->getUri().')',
198 198
                     $result->getStatus(),
199 199
                     $result->getValue(),
200 200
                     $tool,
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
     private function getIdentifier(CheckResult $result)
209 209
     {
210
-        return $this->tool . '_' . $result->getRuleName();
210
+        return $this->tool.'_'.$result->getRuleName();
211 211
     }
212 212
 
213 213
     private function getPrefix($string)
Please login to merge, or discard this patch.
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.