@@ -29,6 +29,7 @@ discard block |
||
29 | 29 | * @param $status |
30 | 30 | * @param $value |
31 | 31 | * @param $message |
32 | + * @param string $url |
|
32 | 33 | */ |
33 | 34 | public function __construct($status, $message = '', $value = null, $url = null) |
34 | 35 | { |
@@ -47,7 +48,7 @@ discard block |
||
47 | 48 | } |
48 | 49 | |
49 | 50 | /** |
50 | - * @param array $attributes |
|
51 | + * @param array $attribute |
|
51 | 52 | */ |
52 | 53 | public function addAttribute(Attribute $attribute) |
53 | 54 | { |
@@ -97,7 +97,7 @@ |
||
97 | 97 | } catch (ValidationFailedException $e) { |
98 | 98 | $result = new CheckResult(CheckResult::STATUS_FAILURE, $e->getMessage()); |
99 | 99 | } catch (\Exception $e) { |
100 | - $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: ' . $e->getMessage()); |
|
100 | + $result = new CheckResult(CheckResult::STATUS_FAILURE, 'An error occured: '.$e->getMessage()); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $this->eventDispatcher->simpleNotify('Scanner.CheckResponse.Rule', array('checkResult' => $result, 'ruleName' => $name)); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use phm\HttpWebdriverClient\Http\Client\Guzzle\GuzzleClient as phmGuzzleClient; |
6 | 6 | use phm\HttpWebdriverClient\Http\Client\Decorator\FileCacheDecorator; |
7 | -use phm\HttpWebdriverClient\Http\Client\Decorator\LoggerDecorator; |
|
8 | 7 | use phm\HttpWebdriverClient\Http\Client\HttpClient; |
9 | 8 | use Psr\Http\Message\RequestInterface; |
10 | 9 |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | private function initConfigArray(array $configArray, array $defaultSettings = null) |
68 | 68 | { |
69 | 69 | if ($defaultSettings === null) { |
70 | - $defaultSettings = Yaml::parse(file_get_contents(__DIR__ . '/../settings/' . self::DEFAULT_SETTINGS)); |
|
70 | + $defaultSettings = Yaml::parse(file_get_contents(__DIR__.'/../settings/'.self::DEFAULT_SETTINGS)); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | if (count($configArray) === 0) { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | if ($this->hasSection($section)) { |
170 | 170 | return $this->configArray[$section]; |
171 | 171 | } else { |
172 | - throw new \RuntimeException('The section (' . $section . ') you are trying to access does not exist.'); |
|
172 | + throw new \RuntimeException('The section ('.$section.') you are trying to access does not exist.'); |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | if (array_key_exists($name, $this->extensions)) { |
179 | 179 | return $this->extensions[$name]; |
180 | 180 | } else { |
181 | - throw new \RuntimeException('The extension ("' . $name . '") you are trying to access does not exist. Registered extensions are: ' . implode(' ,', array_keys($this->extensions)) . '.'); |
|
181 | + throw new \RuntimeException('The extension ("'.$name.'") you are trying to access does not exist. Registered extensions are: '.implode(' ,', array_keys($this->extensions)).'.'); |
|
182 | 182 | } |
183 | 183 | } |
184 | 184 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | try { |
204 | 204 | $client = Init::initialize($this->configArray['client']); |
205 | 205 | } catch (\Exception $e) { |
206 | - throw new ConfigurationException('Error initializing client (' . $e->getMessage() . ')'); |
|
206 | + throw new ConfigurationException('Error initializing client ('.$e->getMessage().')'); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | return $client; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | if (strpos($response->getContentType(), 'image') === false |
26 | 26 | && strpos($response->getContentType(), 'pdf') === false |
27 | 27 | && strpos($response->getContentType(), 'postscript') === false |
28 | - && strlen((string)$response->getBody()) >= $this->minFileSize |
|
28 | + && strlen((string) $response->getBody()) >= $this->minFileSize |
|
29 | 29 | ) { |
30 | 30 | if (!$response->hasHeader('Content-Encoding') || $response->getHeader('Content-Encoding')[0] !== 'gzip') { |
31 | 31 | throw new ValidationFailedException('gzip compression not active'); |
@@ -17,7 +17,6 @@ |
||
17 | 17 | private $maxCookies; |
18 | 18 | |
19 | 19 | /** |
20 | - * @param int $maxDuration The maximum duration a http call is allowed to take (time to first byte) |
|
21 | 20 | */ |
22 | 21 | public function init($maxCookies = 20) |
23 | 22 | { |
@@ -36,12 +36,12 @@ |
||
36 | 36 | if ($cookieCount > $this->maxCookies) { |
37 | 37 | $result = new CheckResult( |
38 | 38 | CheckResult::STATUS_FAILURE, |
39 | - $cookieCount . ' cookies were stored (limit was ' . $this->maxCookies . ').', |
|
39 | + $cookieCount.' cookies were stored (limit was '.$this->maxCookies.').', |
|
40 | 40 | $cookieCount); |
41 | 41 | } else { |
42 | 42 | $result = new CheckResult( |
43 | 43 | CheckResult::STATUS_SUCCESS, |
44 | - $cookieCount . ' cookies were stored (limit was ' . $this->maxCookies . ').', |
|
44 | + $cookieCount.' cookies were stored (limit was '.$this->maxCookies.').', |
|
45 | 45 | $cookieCount); |
46 | 46 | } |
47 | 47 |
@@ -30,19 +30,19 @@ |
||
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 | |
43 | 43 | protected function renderSkipped(CheckResult $result) |
44 | 44 | { |
45 | - $this->output->writeln(' <comment> ' . (string) $result->getResponse()->getUri() . ' </comment>test skipped'); |
|
46 | - $this->output->writeln(' - ' . $result->getMessage() . ' [rule: ' . $result->getRuleName() . ']'); |
|
45 | + $this->output->writeln(' <comment> '.(string) $result->getResponse()->getUri().' </comment>test skipped'); |
|
46 | + $this->output->writeln(' - '.$result->getMessage().' [rule: '.$result->getRuleName().']'); |
|
47 | 47 | } |
48 | 48 | } |