@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @param array $attributes |
|
47 | + * @param array $attribute |
|
48 | 48 | */ |
49 | 49 | public function addAttribute(Attribute $attribute) |
50 | 50 | { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @return mixed |
|
71 | + * @return string |
|
72 | 72 | */ |
73 | 73 | public function getMessage() |
74 | 74 | { |
@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 | } |
@@ -24,7 +24,7 @@ |
||
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, |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | while (($response = $this->responseRetriever->next()) && !$this->eventDispatcher->notifyUntil(new Event('Scanner.Scan.isStopped'))) { |
57 | 57 | |
58 | - var_dump((string)$response->getUri()); |
|
58 | + var_dump((string) $response->getUri()); |
|
59 | 59 | |
60 | 60 | // this is the url filter |
61 | 61 | if ($this->eventDispatcher->notifyUntil(new Event('Scanner.ProcessHtml.isFiltered', array('uri' => $response->getUri())))) { |
62 | 62 | continue; |
63 | 63 | } |
64 | 64 | |
65 | - var_dump((string)$response->getUri()); |
|
65 | + var_dump((string) $response->getUri()); |
|
66 | 66 | |
67 | 67 | $results = $this->checkResponse($response); |
68 | 68 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } catch (ValidationFailedException $e) { |
100 | 100 | $result = new CheckResult(CheckResult::STATUS_FAILURE, $e->getMessage()); |
101 | 101 | } catch (\Exception $e) { |
102 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: ' . $e->getMessage()); |
|
102 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: '.$e->getMessage()); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | $result->setResponse($response); |
@@ -120,7 +120,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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) |