Completed
Push — master ( b0d378...3d9ae5 )
by Nils
04:12
created
src/Rules/Http/RedirectRule.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,23 +31,23 @@
 block discarded – undo
31 31
             $uri = new Uri($url['url']);
32 32
 
33 33
             $urlResponses = $client->sendRequests([new Request('GET', $uri)]);
34
-            $effectiveUrl = (string)$urlResponses[0]->getEffectiveUri();
34
+            $effectiveUrl = (string) $urlResponses[0]->getEffectiveUri();
35 35
 
36
-            if ($effectiveUrl != (string)$response->getUri()) {
37
-                $errors[] = 'The url "' . $url['url'] . '" gets redirected to "' . $effectiveUrl . '".';
36
+            if ($effectiveUrl != (string) $response->getUri()) {
37
+                $errors[] = 'The url "'.$url['url'].'" gets redirected to "'.$effectiveUrl.'".';
38 38
             }
39 39
         }
40 40
 
41 41
         if (count($errors) > 0) {
42
-            $message = 'Not all given urls do redirect to "' . (string)$response->getUri() . '"".<ul>';
42
+            $message = 'Not all given urls do redirect to "'.(string) $response->getUri().'"".<ul>';
43 43
             foreach ($errors as $error) {
44
-                $message .= '<li>' . $error . '</li>';
44
+                $message .= '<li>'.$error.'</li>';
45 45
             }
46 46
             $message .= "</ul>";
47 47
 
48 48
             return new CheckResult(CheckResult::STATUS_FAILURE, $message);
49 49
         } else {
50
-            return new CheckResult(CheckResult::STATUS_SUCCESS, 'All given urls redirect to ' . (string)$response->getUri());
50
+            return new CheckResult(CheckResult::STATUS_SUCCESS, 'All given urls redirect to '.(string) $response->getUri());
51 51
         }
52 52
     }
53 53
 }
Please login to merge, or discard this patch.
src/Rules/Html/InsecureContentRule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
             return true;
45 45
         }
46 46
 
47
-        $htmlDocument = new Document((string)$response->getBody());
47
+        $htmlDocument = new Document((string) $response->getBody());
48 48
 
49 49
         $resources = $htmlDocument->getDependencies($uri, false);
50 50
 
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             if ($resource->getScheme() && 'https' !== $resource->getScheme()) {
55 55
                 $excluded = false;
56 56
                 foreach ($this->excludedFiles as $excludedFile) {
57
-                    if (preg_match('~' . $excludedFile . '~', (string)$resource)) {
57
+                    if (preg_match('~'.$excludedFile.'~', (string) $resource)) {
58 58
                         $excluded = true;
59 59
                         break;
60 60
                     }
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         if (count($unsecures) > 0) {
69 69
             $message = 'At least one dependency was found on a secure url, that was transfered insecure.<ul>';
70 70
             foreach ($unsecures as $unsecure) {
71
-                $message .= '<li>' . (string)$unsecure . '</li>';
71
+                $message .= '<li>'.(string) $unsecure.'</li>';
72 72
             }
73 73
             $message .= '</ul>';
74 74
             return new CheckResult(CheckResult::STATUS_FAILURE, $message, count($unsecures));
Please login to merge, or discard this patch.
src/Rules/Html/ClosingHtmlTagRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         if ($response instanceof ContentTypeAwareResponse) {
18 18
 
19
-            $body = (string)$response->getBody();
19
+            $body = (string) $response->getBody();
20 20
             $body = preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F,\xFF,\x8B]/', '', $body);
21 21
 
22 22
             if (($response->getStatusCode() < 300 || $response->getStatusCode() >= 400)
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
                 && strlen($body) > 0
25 25
             ) {
26 26
                 if (stripos($body, '</html>') === false) {
27
-                    throw new ValidationFailedException('Closing html tag is missing (document length: ' . strlen($body) . ').');
27
+                    throw new ValidationFailedException('Closing html tag is missing (document length: '.strlen($body).').');
28 28
                 }
29 29
             }
30 30
         }
Please login to merge, or discard this patch.