Completed
Push — master ( 831a7e...faba57 )
by Nils
02:45
created
src/Rules/Seo/RobotsDisallowAllRule.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,12 +21,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.