@@ -4,8 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use phm\HttpWebdriverClient\Http\Response\UriAwareResponse; |
| 6 | 6 | use Psr\Http\Message\ResponseInterface; |
| 7 | -use whm\Smoke\Http\ClientAware; |
|
| 8 | -use whm\Smoke\Http\Response; |
|
| 9 | 7 | use whm\Smoke\Rules\Rule; |
| 10 | 8 | use whm\Smoke\Rules\ValidationFailedException; |
| 11 | 9 | |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | public function validate(ResponseInterface $response) |
| 22 | 22 | { |
| 23 | 23 | if ($response instanceof UriAwareResponse) { |
| 24 | - $url = $response->getUri()->getScheme() . '://' . $response->getUri()->getHost(); |
|
| 24 | + $url = $response->getUri()->getScheme().'://'.$response->getUri()->getHost(); |
|
| 25 | 25 | |
| 26 | 26 | if (substr_count($url, '/') === 2) { |
| 27 | - $filename = $robotsUrl = $url . '/robots.txt'; |
|
| 27 | + $filename = $robotsUrl = $url.'/robots.txt'; |
|
| 28 | 28 | } elseif (substr_count($url, '/') === 3) { |
| 29 | - $filename = $robotsUrl = $url . 'robots.txt'; |
|
| 29 | + $filename = $robotsUrl = $url.'robots.txt'; |
|
| 30 | 30 | } else { |
| 31 | 31 | return; |
| 32 | 32 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | |
| 40 | 40 | $normalizedContent = $this->normalizeContent($content); |
| 41 | 41 | |
| 42 | - if (strpos($normalizedContent, 'user-agent:* disallow:/' . PHP_EOL) !== false) { |
|
| 42 | + if (strpos($normalizedContent, 'user-agent:* disallow:/'.PHP_EOL) !== false) { |
|
| 43 | 43 | throw new ValidationFailedException('The robots.txt contains disallow all (Disallow: /)'); |
| 44 | 44 | } |
| 45 | 45 | |