@@ -103,7 +103,7 @@ |
||
103 | 103 | $result = new CheckResult(CheckResult::STATUS_SUCCESS, 'Check successful.'); |
104 | 104 | } |
105 | 105 | } catch (\Exception $e) { |
106 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occurred: ' . $e->getMessage()); |
|
106 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occurred: '.$e->getMessage()); |
|
107 | 107 | $this->eventDispatcher->simpleNotify('Scanner.CheckResponse.Rule.Error', array('checkResult' => $result, 'ruleName' => $name, 'exception' => $e)); |
108 | 108 | } |
109 | 109 |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | |
16 | 16 | private function getEndpoint(UriInterface $uri) |
17 | 17 | { |
18 | - return str_replace('#url#', urlencode((string)$uri), self::ENDPOINT); |
|
18 | + return str_replace('#url#', urlencode((string) $uri), self::ENDPOINT); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | public function validate(ResponseInterface $response) |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | ))); |
39 | 39 | |
40 | 40 | if (property_exists($result, 'error')) { |
41 | - $checkResult = new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Error "' . $result->error->message . '"'); |
|
41 | + $checkResult = new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Error "'.$result->error->message.'"'); |
|
42 | 42 | $checkResult->addAttribute(new Attribute('Google response', json_encode($result), true)); |
43 | 43 | return $checkResult; |
44 | 44 | } |
@@ -46,10 +46,10 @@ discard block |
||
46 | 46 | $passResult = $result->ruleGroups->USABILITY; |
47 | 47 | |
48 | 48 | if (!$passResult->pass) { |
49 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Score ' . $passResult->score . '/100.', (int)$passResult->score); |
|
49 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'Google mobile friendly test was not passed. Score '.$passResult->score.'/100.', (int) $passResult->score); |
|
50 | 50 | |
51 | 51 | } else { |
52 | - $result = new CheckResult(CheckResult::STATUS_SUCCESS, 'Google mobile friendly test passed. Score ' . $passResult->score . '/100.', (int)$passResult->score); |
|
52 | + $result = new CheckResult(CheckResult::STATUS_SUCCESS, 'Google mobile friendly test passed. Score '.$passResult->score.'/100.', (int) $passResult->score); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $result->addAttribute(new Attribute('google_result', json_encode($result), true)); |
@@ -30,13 +30,13 @@ discard block |
||
30 | 30 | private function getSchema($isIndex) |
31 | 31 | { |
32 | 32 | if ($isIndex) { |
33 | - return __DIR__ . '/' . self::INDEX; |
|
33 | + return __DIR__.'/'.self::INDEX; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | if ($this->strictMode) { |
37 | - return __DIR__ . '/' . self::SCHEMA; |
|
37 | + return __DIR__.'/'.self::SCHEMA; |
|
38 | 38 | } else { |
39 | - return __DIR__ . '/' . self::NON_STRICT_SCHEMA; |
|
39 | + return __DIR__.'/'.self::NON_STRICT_SCHEMA; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if (!$valid) { |
57 | 57 | $lastError = libxml_get_last_error(); |
58 | 58 | throw new ValidationFailedException( |
59 | - 'The given sitemap file (' . $filename . ') did not validate against the sitemap schema (last error: ' . str_replace("\n", '', $lastError->message) . ').'); |
|
59 | + 'The given sitemap file ('.$filename.') did not validate against the sitemap schema (last error: '.str_replace("\n", '', $lastError->message).').'); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | protected function doValidation(ResponseInterface $response) |
68 | 68 | { |
69 | 69 | if ($response instanceof DomAwareResponse) { |
70 | - $body = (string)$response->getHtmlBody(); |
|
70 | + $body = (string) $response->getHtmlBody(); |
|
71 | 71 | } else { |
72 | - $body = (string)$response->getBody(); |
|
72 | + $body = (string) $response->getBody(); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | // sitemapindex or urlset |
76 | 76 | if (preg_match('/<sitemapindex/', $body)) { |
77 | - $this->validateBody($body, (string)$response->getUri()); |
|
77 | + $this->validateBody($body, (string) $response->getUri()); |
|
78 | 78 | } elseif (preg_match('/<urlset/', $body)) { |
79 | - $this->validateBody($body, (string)$response->getUri(), false); |
|
79 | + $this->validateBody($body, (string) $response->getUri(), false); |
|
80 | 80 | } else { |
81 | 81 | throw new ValidationFailedException('The given document is not a valid sitemap. Nether sitemapindex nor urlset element was found. '); |
82 | 82 | } |