@@ -15,7 +15,6 @@ |
||
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 | { |
@@ -29,12 +29,12 @@ discard block |
||
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 |
||
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>'; |
@@ -30,18 +30,18 @@ |
||
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 | } |
@@ -36,7 +36,7 @@ |
||
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 | } |
@@ -31,6 +31,6 @@ |
||
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 | } |
@@ -3,7 +3,6 @@ |
||
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 | /** |
@@ -35,7 +35,7 @@ |
||
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 | } |
@@ -4,8 +4,6 @@ |
||
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 | /** |
@@ -27,7 +27,7 @@ |
||
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 | } |
@@ -37,15 +37,15 @@ |
||
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 |
@@ -53,7 +53,7 @@ |
||
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 |
@@ -56,7 +56,7 @@ |
||
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 |