@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $failures = 0; |
60 | 60 | |
61 | 61 | if ($this->retriever instanceof CrawlingRetriever) { |
62 | - $startPage = (string)$this->retriever->getStartPage(); |
|
62 | + $startPage = (string) $this->retriever->getStartPage(); |
|
63 | 63 | } else { |
64 | 64 | $startPage = ''; |
65 | 65 | } |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | $testCase->addFailure(new Failure($ruleName, $message)); |
81 | 81 | |
82 | 82 | if ($this->retriever instanceof CrawlingRetriever) { |
83 | - $stackTrace = $result->getUrl() . ' coming from ' . (string)$this->retriever->getComingFrom($result->getUrl()) . PHP_EOL; |
|
84 | - $stackTrace .= ' - ' . $message . " [rule: $ruleName]"; |
|
83 | + $stackTrace = $result->getUrl().' coming from '.(string) $this->retriever->getComingFrom($result->getUrl()).PHP_EOL; |
|
84 | + $stackTrace .= ' - '.$message." [rule: $ruleName]"; |
|
85 | 85 | $testCase->setSystemOut($stackTrace); |
86 | 86 | } |
87 | 87 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | file_put_contents($this->filename, $xUnitReport->toXml()); |
94 | 94 | |
95 | - $this->output->writeln(' <info>Writing XUnit Output to file:</info> ' . $this->filename); |
|
95 | + $this->output->writeln(' <info>Writing XUnit Output to file:</info> '.$this->filename); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | public function processResults($results) |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function validate(ResponseInterface $response) |
23 | 23 | { |
24 | 24 | if ($response->getStatusCode() > $this->maxStatusCode) { |
25 | - throw new ValidationFailedException('Status code ' . $response->getStatusCode() . ' found.'); |
|
25 | + throw new ValidationFailedException('Status code '.$response->getStatusCode().' found.'); |
|
26 | 26 | } |
27 | 27 | } |
28 | 28 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | public function validate(ResponseInterface $response) |
27 | 27 | { |
28 | 28 | if ($response->getStatusCode() !== $this->expectedStatus) { |
29 | - throw new ValidationFailedException('Status code ' . $response->getStatusCode() . ' found, ' . $this->expectedStatus . ' expected.'); |
|
29 | + throw new ValidationFailedException('Status code '.$response->getStatusCode().' found, '.$this->expectedStatus.' expected.'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -25,8 +25,8 @@ |
||
25 | 25 | protected function doValidation(ResponseInterface $response) |
26 | 26 | { |
27 | 27 | foreach ($this->regExs as $regEx) { |
28 | - $this->assert(preg_match('^' . $regEx . '^', (string)$response->getBody()) === 0, |
|
29 | - 'The given regular expression (' . $regEx . ') was found in this document.'); |
|
28 | + $this->assert(preg_match('^'.$regEx.'^', (string) $response->getBody()) === 0, |
|
29 | + 'The given regular expression ('.$regEx.') was found in this document.'); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 | } |
@@ -26,7 +26,7 @@ |
||
26 | 26 | |
27 | 27 | protected function doValidation(ResponseInterface $response) |
28 | 28 | { |
29 | - $document = new Document((string)$response->getBody()); |
|
29 | + $document = new Document((string) $response->getBody()); |
|
30 | 30 | $files = $this->getFilesToCount($document, $response); |
31 | 31 | |
32 | 32 | $this->assert(count($files) <= $this->maxCount, sprintf($this->errorMessage, count($files))); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return; |
19 | 19 | } |
20 | 20 | |
21 | - $crawler = new Crawler((string)$response->getBody()); |
|
21 | + $crawler = new Crawler((string) $response->getBody()); |
|
22 | 22 | |
23 | 23 | $idList = $crawler->filterXPath('//*[@id!=""]'); |
24 | 24 | |
@@ -36,7 +36,7 @@ discard block |
||
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 | } |
@@ -26,9 +26,9 @@ |
||
26 | 26 | |
27 | 27 | public function doValidation(ResponseInterface $response) |
28 | 28 | { |
29 | - $result = json_decode((string)$response->getBody()); |
|
29 | + $result = json_decode((string) $response->getBody()); |
|
30 | 30 | if ($result === null) { |
31 | - throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "')."); |
|
31 | + throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."')."); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |
@@ -33,9 +33,9 @@ discard block |
||
33 | 33 | |
34 | 34 | protected function doValidation(ResponseInterface $response) |
35 | 35 | { |
36 | - $data = json_decode((string)$response->getBody()); |
|
36 | + $data = json_decode((string) $response->getBody()); |
|
37 | 37 | if ($data === null) { |
38 | - throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "')."); |
|
38 | + throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."')."); |
|
39 | 39 | } else { |
40 | 40 | $errorStatus = false; |
41 | 41 | $messageParts = array(); |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | $errorStatus = true; |
52 | 52 | $errorMessage = ''; |
53 | 53 | foreach ($validator->getErrors() as $error) { |
54 | - $errorMessage = $errorMessage . sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
54 | + $errorMessage = $errorMessage.sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
55 | 55 | } |
56 | - $messageParts[] = $jsonSchemaFile['jsonfilename'] . ' - ' . $jsonSchemaFile['jsonfileurl'] . '(last error: ' . $errorMessage . ').'; |
|
56 | + $messageParts[] = $jsonSchemaFile['jsonfilename'].' - '.$jsonSchemaFile['jsonfileurl'].'(last error: '.$errorMessage.').'; |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($errorStatus === true) { |
61 | - $message = 'JSON file (' . (string) $response->getUri() . ') does not validate against the following JSON Schema files: ' . implode(', ', $messageParts); |
|
61 | + $message = 'JSON file ('.(string) $response->getUri().') does not validate against the following JSON Schema files: '.implode(', ', $messageParts); |
|
62 | 62 | throw new ValidationFailedException($message); |
63 | 63 | } |
64 | 64 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | protected function doValidation(ResponseInterface $response) |
28 | 28 | { |
29 | - $document = new Document((string)$response->getBody()); |
|
29 | + $document = new Document((string) $response->getBody()); |
|
30 | 30 | $images = $document->getImages($response->getUri()); |
31 | 31 | |
32 | 32 | $foreignImages = array(); |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | foreach ($images as $image) { |
38 | 38 | /* @var $image Uri */ |
39 | 39 | if ($currentUri->getHost($this->depth) !== $image->getHost($this->depth)) { |
40 | - $foreignImages[] = (string)$image; |
|
40 | + $foreignImages[] = (string) $image; |
|
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 | } |