@@ -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 | } |
@@ -29,14 +29,14 @@ |
||
29 | 29 | if ($response->getDuration() > $this->maxDuration) { |
30 | 30 | return new CheckResult( |
31 | 31 | CheckResult::STATUS_FAILURE, |
32 | - 'The http request took ' . (int)$response->getDuration() . ' milliseconds (limit was ' . $this->maxDuration . 'ms).', |
|
33 | - (int)$response->getDuration()); |
|
32 | + 'The http request took '.(int) $response->getDuration().' milliseconds (limit was '.$this->maxDuration.'ms).', |
|
33 | + (int) $response->getDuration()); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | return new CheckResult( |
37 | 37 | CheckResult::STATUS_SUCCESS, |
38 | - 'The http request took ' . (int)$response->getDuration() . ' milliseconds.', |
|
39 | - (int)$response->getDuration()); |
|
38 | + 'The http request took '.(int) $response->getDuration().' milliseconds.', |
|
39 | + (int) $response->getDuration()); |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | foreach ($resources as $resource) { |
35 | 35 | if ($resource->getScheme() && 'https' !== $resource->getScheme()) { |
36 | - throw new ValidationFailedException('At least one dependency was found on a secure url, that was transfered insecure (' . (string)$resource . ')'); |
|
36 | + throw new ValidationFailedException('At least one dependency was found on a secure url, that was transfered insecure ('.(string) $resource.')'); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 | } |
@@ -25,6 +25,6 @@ |
||
25 | 25 | protected function doValidation(ResponseInterface $response) |
26 | 26 | { |
27 | 27 | $this->assert(strpos($response->getBody(), $this->string) !== false, |
28 | - 'The given string (' . $this->string . ') was not found in this document.'); |
|
28 | + 'The given string ('.$this->string.') was not found in this document.'); |
|
29 | 29 | } |
30 | 30 | } |
@@ -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,6 +26,6 @@ |
||
26 | 26 | protected function doValidation(ResponseInterface $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 | } |
@@ -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>'; |
@@ -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))); |
@@ -37,10 +37,10 @@ |
||
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 | } |