Completed
Push — master ( 33a55e...ca53a0 )
by Nils
07:47
created
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/Xml/DuplicateIdRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
 
37 37
         if (count($duplicatedIds) > 0) {
38 38
             unset($duplicatedIds['']);
39
-            throw new ValidationFailedException('Duplicate ids found (' . implode(', ', array_keys($duplicatedIds)) . ')');
39
+            throw new ValidationFailedException('Duplicate ids found ('.implode(', ', array_keys($duplicatedIds)).')');
40 40
         }
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/Rules/Image/FavIconRule.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,6 +31,6 @@
 block discarded – undo
31 31
 
32 32
         $imageHash = md5($response->getBody());
33 33
 
34
-        $this->assert(!array_key_exists($imageHash, $this->favicons), 'Seems like you use the standard favicon of your framework (' . $this->favicons[$imageHash] . ').');
34
+        $this->assert(!array_key_exists($imageHash, $this->favicons), 'Seems like you use the standard favicon of your framework ('.$this->favicons[$imageHash].').');
35 35
     }
36 36
 }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 namespace whm\Smoke\Rules\Image;
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6
-use whm\Smoke\Http\Response;
7 6
 use whm\Smoke\Rules\StandardRule;
8 7
 
9 8
 /**
Please login to merge, or discard this patch.
src/Rules/Security/PasswordSecureTransferRule.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
 
36 36
             while ($parent = $parent->parentNode) {
37 37
                 if (property_exists($parent, 'tagName')) {
38
-                    $fullPath = $parent->tagName . '/' . $fullPath;
38
+                    $fullPath = $parent->tagName.'/'.$fullPath;
39 39
                 } else {
40 40
                     break;
41 41
                 }
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Psr\Http\Message\ResponseInterface;
6 6
 use Symfony\Component\DomCrawler\Crawler;
7
-use whm\Smoke\Http\Response;
8
-use whm\Smoke\Rules\Rule;
9 7
 use whm\Smoke\Rules\StandardRule;
10 8
 
11 9
 /**
Please login to merge, or discard this patch.
src/Rules/Json/ValidRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     {
28 28
         $result = json_decode($response->getBody());
29 29
         if ($result === null) {
30
-            throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "').");
30
+            throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."').");
31 31
         }
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
src/Cli/Command/ExplainCommand.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,15 +37,15 @@
 block discarded – undo
37 37
 
38 38
         foreach ($rules as $name => $rule) {
39 39
             $info = Init::getInitInformationByClass(get_class($rule));
40
-            $output->writeln('  ' . $name . ':');
41
-            $output->writeln('    class: ' . get_class($rule));
42
-            $output->writeln('    description: ' . str_replace("\n", "\n                 ", $info['documentation']));
40
+            $output->writeln('  '.$name.':');
41
+            $output->writeln('    class: '.get_class($rule));
42
+            $output->writeln('    description: '.str_replace("\n", "\n                 ", $info['documentation']));
43 43
 
44 44
             if (count($info['parameters']) > 0) {
45 45
                 $output->writeln('    parameter:');
46 46
 
47 47
                 foreach ($info['parameters'] as $parameter) {
48
-                    $output->writeln('      ' . $parameter['name'] . ': ' . $parameter['description'] . ' (default: ' . $parameter['default'] . ')');
48
+                    $output->writeln('      '.$parameter['name'].': '.$parameter['description'].' (default: '.$parameter['default'].')');
49 49
                 }
50 50
             }
51 51
 
Please login to merge, or discard this patch.
src/Cli/Command/ScanCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
53 53
      */
54 54
     private function initConfiguration($num_urls, $run_level, Uri $uri, Dispatcher $dispatcher)
55 55
     {
56
-        $configArray = $this->getConfigArray(__DIR__ . '/../../settings/' . self::CONFIG_FILE);
56
+        $configArray = $this->getConfigArray(__DIR__.'/../../settings/'.self::CONFIG_FILE);
57 57
 
58 58
         $config = new Configuration($uri, $dispatcher, $configArray);
59 59
 
Please login to merge, or discard this patch.
src/Cli/Command/WarmUpCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
      */
57 57
     private function initConfiguration(Uri $uri, Dispatcher $dispatcher)
58 58
     {
59
-        $configArray = $this->getConfigArray(__DIR__ . '/../../settings/warmup.yml');
59
+        $configArray = $this->getConfigArray(__DIR__.'/../../settings/warmup.yml');
60 60
 
61 61
         $config = new Configuration($uri, $dispatcher, $configArray);
62 62
 
Please login to merge, or discard this patch.