@@ -28,30 +28,30 @@ discard block |
||
| 28 | 28 | $client = new GuzzleClient(); |
| 29 | 29 | $errors = []; |
| 30 | 30 | |
| 31 | - $targetUrl = (string)$this->removeCredentials($response->getUri()); |
|
| 31 | + $targetUrl = (string) $this->removeCredentials($response->getUri()); |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | foreach ($this->urls as $url) { |
| 35 | 35 | $uri = new Uri($url['url']); |
| 36 | 36 | |
| 37 | 37 | $urlResponses = $client->sendRequests([new Request('GET', $uri)]); |
| 38 | - $effectiveUrl = (string)$urlResponses[0]->getEffectiveUri(); |
|
| 38 | + $effectiveUrl = (string) $urlResponses[0]->getEffectiveUri(); |
|
| 39 | 39 | |
| 40 | 40 | if ($effectiveUrl != $targetUrl) { |
| 41 | - $errors[] = 'The url "' . $url['url'] . '" gets redirected to "' . $effectiveUrl . '".'; |
|
| 41 | + $errors[] = 'The url "'.$url['url'].'" gets redirected to "'.$effectiveUrl.'".'; |
|
| 42 | 42 | } |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (count($errors) > 0) { |
| 46 | - $message = 'Not all given urls do redirect to "' . $targetUrl . '"".<ul>'; |
|
| 46 | + $message = 'Not all given urls do redirect to "'.$targetUrl.'"".<ul>'; |
|
| 47 | 47 | foreach ($errors as $error) { |
| 48 | - $message .= '<li>' . $error . '</li>'; |
|
| 48 | + $message .= '<li>'.$error.'</li>'; |
|
| 49 | 49 | } |
| 50 | 50 | $message .= "</ul>"; |
| 51 | 51 | |
| 52 | 52 | return new CheckResult(CheckResult::STATUS_FAILURE, $message); |
| 53 | 53 | } else { |
| 54 | - return new CheckResult(CheckResult::STATUS_SUCCESS, 'All given urls redirect to ' . (string)$response->getUri()); |
|
| 54 | + return new CheckResult(CheckResult::STATUS_SUCCESS, 'All given urls redirect to '.(string) $response->getUri()); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | { |
| 60 | 60 | $query = ''; |
| 61 | 61 | if ($uri->getQuery()) { |
| 62 | - $query = "?" . $uri->getQuery(); |
|
| 62 | + $query = "?".$uri->getQuery(); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - $plainUri = $uri->getScheme() . '://' . $uri->getHost() . $uri->getPath() . $query; |
|
| 65 | + $plainUri = $uri->getScheme().'://'.$uri->getHost().$uri->getPath().$query; |
|
| 66 | 66 | |
| 67 | 67 | return new Uri($plainUri); |
| 68 | 68 | } |