Completed
Push — master ( 44c2f0...c10809 )
by Nils
03:26
created
src/Http/Response.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -13,6 +13,9 @@
 block discarded – undo
13 13
         return $this->getStatusCode();
14 14
     }
15 15
 
16
+    /**
17
+     * @return string
18
+     */
16 19
     public function getContentType()
17 20
     {
18 21
         $exploded = explode(';', $this->hasHeader('Content-Type') ? $this->getHeader('Content-Type')[0] : null);
Please login to merge, or discard this patch.
src/Rules/Html/RegExExistsRule.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
     protected $contentTypes = array('text/html');
16 16
 
17 17
     /**
18
-     * @param int $string The string that the document must contain
19 18
      */
20 19
     public function init(array $regExs)
21 20
     {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,12 +29,12 @@  discard block
 block discarded – undo
29 29
 
30 30
         foreach ($this->regExs as $regEx) {
31 31
             if ($regEx['isRegEx']) {
32
-                if (preg_match('^' . $regEx['pattern'] . '^', (string) $response->getBody()) === 0) {
33
-                    $errors[] = 'Regular expression: ' . $regEx['pattern'];
32
+                if (preg_match('^'.$regEx['pattern'].'^', (string) $response->getBody()) === 0) {
33
+                    $errors[] = 'Regular expression: '.$regEx['pattern'];
34 34
                 }
35 35
             } else {
36
-                if (preg_match('^' . preg_quote($regEx['pattern']) . '^', (string) $response->getBody()) === 0) {
37
-                    $errors[] = 'Text: ' . $regEx['pattern'];
36
+                if (preg_match('^'.preg_quote($regEx['pattern']).'^', (string) $response->getBody()) === 0) {
37
+                    $errors[] = 'Text: '.$regEx['pattern'];
38 38
                 }
39 39
             }
40 40
         }
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             $errorString = 'The following text elements were not found: <ul>';
44 44
 
45 45
             foreach ($errors as $error) {
46
-                $errorString .= '<li>' . $error . '</li>';
46
+                $errorString .= '<li>'.$error.'</li>';
47 47
             }
48 48
 
49 49
             $errorString .= '</ul>';
Please login to merge, or discard this patch.
src/Rules/Js/SyntaxRule.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,18 +30,18 @@
 block discarded – undo
30 30
             return;
31 31
         }
32 32
 
33
-        $filename = $this->tmpDir . DIRECTORY_SEPARATOR . md5($response->getBody()) . '.js';
33
+        $filename = $this->tmpDir.DIRECTORY_SEPARATOR.md5($response->getBody()).'.js';
34 34
         file_put_contents($filename, $response->getBody());
35
-        $conf = __DIR__ . DIRECTORY_SEPARATOR . 'jsHint.conf';
35
+        $conf = __DIR__.DIRECTORY_SEPARATOR.'jsHint.conf';
36 36
 
37
-        $command = $this->jsHintExecutable . ' --config ' . $conf . ' --verbose ' . $filename . ' | grep -E E[0-9]+.$';
37
+        $command = $this->jsHintExecutable.' --config '.$conf.' --verbose '.$filename.' | grep -E E[0-9]+.$';
38 38
         $validationResult = shell_exec($command);
39 39
 
40 40
         unlink($filename);
41 41
 
42 42
         if (!is_null($validationResult)) {
43
-            $errorMsg = str_replace($filename . ':', '', $validationResult);
44
-            throw new ValidationFailedException('JavaScript error found: ' . $errorMsg);
43
+            $errorMsg = str_replace($filename.':', '', $validationResult);
44
+            throw new ValidationFailedException('JavaScript error found: '.$errorMsg);
45 45
         }
46 46
     }
47 47
 }
Please login to merge, or discard this patch.
src/Rules/Http/Header/SuccessStatusRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
     public function validate(Response $response)
22 22
     {
23 23
         if ($response->getStatus() > $this->maxStatusCode) {
24
-            throw new ValidationFailedException('Status code ' . $response->getStatus() . ' found.');
24
+            throw new ValidationFailedException('Status code '.$response->getStatus().' found.');
25 25
         }
26 26
     }
27 27
 }
Please login to merge, or discard this patch.
src/Rules/Http/Header/HttpStatusRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     public function validate(Response $response)
26 26
     {
27 27
         if ($response->getStatus() !== $this->expectedStatus) {
28
-            throw new ValidationFailedException('Status code ' . $response->getStatus() . ' found, ' . $this->expectedStatus . ' expected.');
28
+            throw new ValidationFailedException('Status code '.$response->getStatus().' found, '.$this->expectedStatus.' expected.');
29 29
         }
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Rules/Html/SizeRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,6 +26,6 @@
 block discarded – undo
26 26
     protected function doValidation(Response $response)
27 27
     {
28 28
         $size = strlen($response->getBody()) / 1000;
29
-        $this->assert($size <= $this->maxSize, 'The size of this html file is too big (' . $size . ' KB)');
29
+        $this->assert($size <= $this->maxSize, 'The size of this html file is too big ('.$size.' KB)');
30 30
     }
31 31
 }
Please login to merge, or discard this patch.
src/Rules/Html/ForeignDomainImageRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,6 +41,6 @@
 block discarded – undo
41 41
             }
42 42
         }
43 43
 
44
-        $this->assert(count($foreignImages) === 0, 'Images from a foreign domain where found (' . implode(', ', $foreignImages) . ')');
44
+        $this->assert(count($foreignImages) === 0, 'Images from a foreign domain where found ('.implode(', ', $foreignImages).')');
45 45
     }
46 46
 }
Please login to merge, or discard this patch.
src/Rules/Html/InsecureContentRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 
33 33
         foreach ($resources as $resource) {
34 34
             if ($resource->getScheme() && 'https' !== $resource->getScheme()) {
35
-                throw new ValidationFailedException('At least one dependency was found on a secure url, that was transfered insecure (' . (string) $resource . ')');
35
+                throw new ValidationFailedException('At least one dependency was found on a secure url, that was transfered insecure ('.(string) $resource.')');
36 36
             }
37 37
         }
38 38
     }
Please login to merge, or discard this patch.
src/Rules/Html/StringNotExistsRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,6 +25,6 @@
 block discarded – undo
25 25
     public function doValidation(Response $response)
26 26
     {
27 27
         $this->assert(strpos($response->getBody(), $this->string) !== false,
28
-            'The given string (' . $this->string . ') was found in this document.');
28
+            'The given string ('.$this->string.') was found in this document.');
29 29
     }
30 30
 }
Please login to merge, or discard this patch.