Completed
Push — master ( 9b8114...2ed294 )
by Nils
02:31
created
src/Rules/Json/JsonSchema/JsonSchemaRule.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $data = json_decode($response->getBody());
38 38
         if ($data === null) {
39
-            throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "').");
39
+            throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."').");
40 40
         } else {
41 41
             $error = false;
42 42
             $messageParts = array();
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
                     $error = true;
54 54
                     $errorMessage = '';
55 55
                     foreach ($validator->getErrors() as $error) {
56
-                        $errorMessage = $errorMessage . sprintf("[%s] %s\n", $error['property'], $error['message']);
56
+                        $errorMessage = $errorMessage.sprintf("[%s] %s\n", $error['property'], $error['message']);
57 57
                     }
58
-                    $messageParts[] = $jsonSchemaFile['jsonschemafilename'] . ' - ' . $jsonSchemaFile['jsonschemafileurl'] . '(last error: ' . $errorMessage . ').';
58
+                    $messageParts[] = $jsonSchemaFile['jsonschemafilename'].' - '.$jsonSchemaFile['jsonschemafileurl'].'(last error: '.$errorMessage.').';
59 59
                 }
60 60
             }
61 61
 
62 62
             if ($error === true) {
63
-                $message = 'JSON file (' . (string) $response->getUri() . ')  does not validate against the following JSON Schema files: ' . implode(', ', $messageParts);
63
+                $message = 'JSON file ('.(string) $response->getUri().')  does not validate against the following JSON Schema files: '.implode(', ', $messageParts);
64 64
                 throw new ValidationFailedException($message);
65 65
             }
66 66
         }
Please login to merge, or discard this patch.
src/Rules/Html/ClosingHtmlTagRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
     {
16 16
         if (($response->getStatus() < 300 || $response->getStatus() >= 400) && $response->getContentType() === 'text/html') {
17 17
             if (stripos($response->getBody(), '</html>') === false) {
18
-                throw new ValidationFailedException('Closing html tag is missing (document lengh: ' . strlen($response->getBody()) . ').');
18
+                throw new ValidationFailedException('Closing html tag is missing (document lengh: '.strlen($response->getBody()).').');
19 19
             }
20 20
         }
21 21
     }
Please login to merge, or discard this patch.
src/Rules/Seo/GoogleMobileFriendlyRule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
         var_dump($result);
36 36
 
37 37
         if ($result->error) {
38
-            throw new ValidationFailedException('Google mobile friendly test was not passed. Error "' . $result->error->message . '"');
38
+            throw new ValidationFailedException('Google mobile friendly test was not passed. Error "'.$result->error->message.'"');
39 39
         }
40 40
 
41 41
         $passResult = $result->ruleGroups->USABILITY;
42 42
 
43 43
         if (!$passResult->pass) {
44
-            throw new ValidationFailedException('Google mobile friendly test was not passed. Score ' . $passResult->score . '/100.');
44
+            throw new ValidationFailedException('Google mobile friendly test was not passed. Score '.$passResult->score.'/100.');
45 45
         }
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
src/Extensions/CookieMaker/CookieMakerExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         $this->sessionContainer = new SessionContainer();
21 21
 
22 22
         foreach ($sessions as $sessionName => $session) {
23
-            $command = $this->executable . " '" . json_encode($session) . "'";
23
+            $command = $this->executable." '".json_encode($session)."'";
24 24
 
25 25
             exec($command, $output, $return);
26 26
 
Please login to merge, or discard this patch.
src/Rules/Seo/RobotsDisallowAllRule.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -49,6 +49,9 @@
 block discarded – undo
49 49
         }
50 50
     }
51 51
 
52
+    /**
53
+     * @param string $content
54
+     */
52 55
     private function normalizeContent($content)
53 56
     {
54 57
         $normalizedContent = strtolower($content);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@  discard block
 block discarded – undo
20 20
 
21 21
     public function validate(Response $response)
22 22
     {
23
-        $url = $response->getUri()->getScheme() . '://' . $response->getUri()->getHost();
23
+        $url = $response->getUri()->getScheme().'://'.$response->getUri()->getHost();
24 24
 
25 25
         if (substr_count($url, '/') === 2) {
26
-            $filename = $robotsUrl = $url . '/robots.txt';
26
+            $filename = $robotsUrl = $url.'/robots.txt';
27 27
         } elseif (substr_count($url, '/') === 3) {
28
-            $filename = $robotsUrl = $url . 'robots.txt';
28
+            $filename = $robotsUrl = $url.'robots.txt';
29 29
         } else {
30 30
             return;
31 31
         }
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
         $normalizedContent = $this->normalizeContent($content);
42 42
 
43
-        if (strpos($normalizedContent, 'user-agent:* disallow:/' . PHP_EOL) !== false) {
43
+        if (strpos($normalizedContent, 'user-agent:* disallow:/'.PHP_EOL) !== false) {
44 44
             throw new ValidationFailedException('The robots.txt contains disallow all (Disallow: /)');
45 45
         }
46 46
 
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/LeankoalaReporter.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -182,6 +182,11 @@
 block discarded – undo
182 182
         return substr($string, 0, strpos($string, '_'));
183 183
     }
184 184
 
185
+    /**
186
+     * @param string $identifier
187
+     * @param string $message
188
+     * @param string $tool
189
+     */
185 190
     private function send($identifier, $system, $message, $status, $value, $tool, $component)
186 191
     {
187 192
         $event = new Event($identifier, $system, $status, $tool, $message, $value, '', $component);
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         foreach ($this->results as $results) {
111 111
             foreach ($results as $result) {
112 112
                 /* @var CheckResult $result */
113
-                $tool = 'Smoke' . $result->getRuleName();
113
+                $tool = 'Smoke'.$result->getRuleName();
114 114
                 $checks[$tool][] = $result;
115 115
             }
116 116
         }
@@ -120,19 +120,19 @@  discard block
 block discarded – undo
120 120
                 continue;
121 121
             }
122 122
 
123
-            $message = 'The smoke test for #system_name# failed (Rule: ' . $toolName . ').<ul>';
123
+            $message = 'The smoke test for #system_name# failed (Rule: '.$toolName.').<ul>';
124 124
             $status = Event::STATUS_SUCCESS;
125 125
             $failureCount = 0;
126
-            $identifier = $toolName . '_' . $this->system;
126
+            $identifier = $toolName.'_'.$this->system;
127 127
 
128 128
             foreach ($results as $result) {
129 129
                 /** @var CheckResult $result */
130 130
                 if ($result->getStatus() === CheckResult::STATUS_FAILURE) {
131 131
                     $comingFrom = '';
132 132
                     if ($this->addComingFrom && $this->retriever->getComingFrom($result->getResponse()->getUri())) {
133
-                        $comingFrom = ', coming from: ' . $this->retriever->getComingFrom($result->getResponse()->getUri());
133
+                        $comingFrom = ', coming from: '.$this->retriever->getComingFrom($result->getResponse()->getUri());
134 134
                     }
135
-                    $message .= '<li>' . $result->getMessage() . ' (url: ' . (string) $result->getResponse()->getUri() . $comingFrom . ')</li>';
135
+                    $message .= '<li>'.$result->getMessage().' (url: '.(string) $result->getResponse()->getUri().$comingFrom.')</li>';
136 136
                     ++$failureCount;
137 137
                 }
138 138
             }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
                 $status = Event::STATUS_FAILURE;
141 141
                 $message .= '</ul>';
142 142
             } else {
143
-                $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:' . $toolName . '].';
143
+                $message = 'All checks for system "#system_name#" succeeded [SmokeBasic:'.$toolName.'].';
144 144
             }
145 145
 
146 146
             $this->send($identifier, $this->system, $message, $status, $failureCount, $this->tool, $this->system);
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             foreach ($results as $result) {
154 154
                 /* @var CheckResult $result */
155 155
 
156
-                $identifier = '_' . $this->getIdentifier($result);
156
+                $identifier = '_'.$this->getIdentifier($result);
157 157
                 $tool = $this->getPrefix($result->getRuleName());
158 158
 
159 159
                 $component = $this->getComponent($result->getRuleName());
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                 $this->send(
163 163
                     $identifier,
164 164
                     $system,
165
-                    $result->getMessage() . ' (url: ' . (string) $result->getResponse()->getUri() . ')',
165
+                    $result->getMessage().' (url: '.(string) $result->getResponse()->getUri().')',
166 166
                     $result->getStatus(),
167 167
                     $result->getValue(),
168 168
                     $tool,
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
     private function getIdentifier(CheckResult $result)
176 176
     {
177
-        return $this->tool . '_' . $result->getRuleName();
177
+        return $this->tool.'_'.$result->getRuleName();
178 178
     }
179 179
 
180 180
     private function getPrefix($string)
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/StandardCliReporter.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -72,6 +72,9 @@
 block discarded – undo
72 72
         $this->output->writeln('');
73 73
     }
74 74
 
75
+    /**
76
+     * @param integer $ruleKey
77
+     */
75 78
     private function getFailedUrls($ruleKey)
76 79
     {
77 80
         $failedUrls = array();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
                 /** @var CheckResult $result */
82 82
                 if ($result->getStatus() === CheckResult::STATUS_FAILURE) {
83 83
                     if ($ruleKey === $key) {
84
-                        $failedUrls[] = (string) $result->getResponse()->getUri() . ' - ' . $result->getMessage();
84
+                        $failedUrls[] = (string) $result->getResponse()->getUri().' - '.$result->getMessage();
85 85
                         ++$count;
86 86
                     }
87 87
                     if ($count > $this->maxResults) {
88
-                        $failedUrls[] = '... only the first ' . $this->maxResults . ' elements are shown.';
88
+                        $failedUrls[] = '... only the first '.$this->maxResults.' elements are shown.';
89 89
                         break;
90 90
                     }
91 91
                 }
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
             $failedUrls = $this->getFailedUrls($ruleKey);
105 105
 
106 106
             if (count($failedUrls) > 0) {
107
-                $this->output->writeln('  <error> ' . get_class($rule) . ' </error>');
107
+                $this->output->writeln('  <error> '.get_class($rule).' </error>');
108 108
             } else {
109
-                $this->output->writeln('  <info> ' . get_class($rule) . ' </info>');
109
+                $this->output->writeln('  <info> '.get_class($rule).' </info>');
110 110
             }
111 111
 
112
-            $this->output->writeln('   ' . str_replace("\n", "\n   ", $info['documentation']) . "\n");
112
+            $this->output->writeln('   '.str_replace("\n", "\n   ", $info['documentation'])."\n");
113 113
 
114 114
             foreach ($failedUrls as $failedUrl) {
115
-                $this->output->writeln('   - ' . $failedUrl);
115
+                $this->output->writeln('   - '.$failedUrl);
116 116
             }
117 117
 
118 118
             $this->output->writeln('');
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/CliReporter.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,13 +30,13 @@
 block discarded – undo
30 30
 
31 31
     protected function renderFailure(CheckResult $result)
32 32
     {
33
-        $this->output->writeln('   <error> ' . (string) $result->getResponse()->getUri() . ' </error> coming from ' . (string) $this->retriever->getComingFrom($result->getResponse()->getUri()));
34
-        $this->output->writeln('    - ' . $result->getMessage() . ' [rule: ' . $result->getRuleName() . ']');
33
+        $this->output->writeln('   <error> '.(string) $result->getResponse()->getUri().' </error> coming from '.(string) $this->retriever->getComingFrom($result->getResponse()->getUri()));
34
+        $this->output->writeln('    - '.$result->getMessage().' [rule: '.$result->getRuleName().']');
35 35
         $this->output->writeln('');
36 36
     }
37 37
 
38 38
     protected function renderSuccess(CheckResult $result)
39 39
     {
40
-        $this->output->writeln('   <info> ' . (string) $result->getResponse()->getUri() . ' </info> all tests passed');
40
+        $this->output->writeln('   <info> '.(string) $result->getResponse()->getUri().' </info> all tests passed');
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/Extensions/SmokeReporter/Reporter/WarmUpLiveReporter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
     public function processResults($results)
18 18
     {
19 19
         ++$this->urlCount;
20
-        $this->output->writeln('   ' . array_pop($result)->getUrl());
20
+        $this->output->writeln('   '.array_pop($result)->getUrl());
21 21
         $this->output->writeln('');
22 22
     }
23 23
 
24 24
     public function finish()
25 25
     {
26
-        $this->output->writeln('   <comment>Warm up finished. ' . $this->urlCount . ' urls visited.</comment>');
26
+        $this->output->writeln('   <comment>Warm up finished. '.$this->urlCount.' urls visited.</comment>');
27 27
         $this->output->writeln('');
28 28
     }
29 29
 }
Please login to merge, or discard this patch.