@@ -65,17 +65,17 @@ |
||
| 65 | 65 | |
| 66 | 66 | if ($jsonValue === FALSE || (is_array($jsonValue) && empty($jsonValue))) { |
| 67 | 67 | $error = true; |
| 68 | - $noCorrectJsonPaths[] = $path['pattern'] . ' (JSON Path not found)'; |
|
| 68 | + $noCorrectJsonPaths[] = $path['pattern'].' (JSON Path not found)'; |
|
| 69 | 69 | } |
| 70 | 70 | if ($this->checkRelation($path['relation'], $path['value'], $count) === false) { |
| 71 | 71 | $error = true; |
| 72 | - $noCorrectJsonPaths[] = $path['pattern'] . ' (number of JSONPaths is not correct corresponding to the given relation/value)'; |
|
| 72 | + $noCorrectJsonPaths[] = $path['pattern'].' (number of JSONPaths is not correct corresponding to the given relation/value)'; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | if ($error === true) { |
| 77 | 77 | $allNoCorrectJsonPaths = implode('", "', $noCorrectJsonPaths); |
| 78 | - throw new ValidationFailedException('Disonances with JSON Paths "' . $allNoCorrectJsonPaths . '!'); |
|
| 78 | + throw new ValidationFailedException('Disonances with JSON Paths "'.$allNoCorrectJsonPaths.'!'); |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -46,7 +46,7 @@ |
||
| 46 | 46 | if ($error === true) { |
| 47 | 47 | $allNotFoundSelectors = implode('", "', $snotFoundSelectors); |
| 48 | 48 | |
| 49 | - throw new ValidationFailedException('CSS Selector "' . $allNotFoundSelectors . '" not found in DOM.'); |
|
| 49 | + throw new ValidationFailedException('CSS Selector "'.$allNotFoundSelectors.'" not found in DOM.'); |
|
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | } |
@@ -13,12 +13,12 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | public function validate(Response $response) |
| 15 | 15 | { |
| 16 | - $url = $response->getUri()->getScheme() . '://' . $response->getUri()->getHost(); |
|
| 16 | + $url = $response->getUri()->getScheme().'://'.$response->getUri()->getHost(); |
|
| 17 | 17 | |
| 18 | 18 | if (substr_count($url, '/') === 2) { |
| 19 | - $filename = $robotsUrl = $url . '/robots.txt'; |
|
| 19 | + $filename = $robotsUrl = $url.'/robots.txt'; |
|
| 20 | 20 | } elseif (substr_count($url, '/') === 3) { |
| 21 | - $filename = $robotsUrl = $url . 'robots.txt'; |
|
| 21 | + $filename = $robotsUrl = $url.'robots.txt'; |
|
| 22 | 22 | } else { |
| 23 | 23 | return; |
| 24 | 24 | } |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $content = file_get_contents($filename); |
| 31 | 31 | $normalizedContent = strtolower(str_replace(' ', '', $content)); |
| 32 | 32 | |
| 33 | - if (strpos($normalizedContent, 'disallow:/' . PHP_EOL) !== false) { |
|
| 33 | + if (strpos($normalizedContent, 'disallow:/'.PHP_EOL) !== false) { |
|
| 34 | 34 | throw new ValidationFailedException('The robots.txt contains disallow all (Disallow: /)'); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -39,12 +39,12 @@ |
||
| 39 | 39 | $error = true; |
| 40 | 40 | $lastError = libxml_get_last_error(); |
| 41 | 41 | |
| 42 | - $messageParts[] = $xsdFile['xsdfilename'] . ' - ' . $xsdFile['xsdfileurl'] . '(last error: ' . str_replace("\n", '', $lastError->message) . ').'; |
|
| 42 | + $messageParts[] = $xsdFile['xsdfilename'].' - '.$xsdFile['xsdfileurl'].'(last error: '.str_replace("\n", '', $lastError->message).').'; |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | if ($error === true) { |
| 47 | - $message = 'XML file (' . $filename . ') does not validate against the following XSD files: ' . implode(', ', $messageParts); |
|
| 47 | + $message = 'XML file ('.$filename.') does not validate against the following XSD files: '.implode(', ', $messageParts); |
|
| 48 | 48 | throw new ValidationFailedException($message); |
| 49 | 49 | } |
| 50 | 50 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $data = json_decode($response->getBody()); |
| 38 | 38 | if ($data === null) { |
| 39 | - throw new ValidationFailedException("The given JSON data can not be validated (last error: '" . $this->json_errors[json_last_error()] . "')."); |
|
| 39 | + throw new ValidationFailedException("The given JSON data can not be validated (last error: '".$this->json_errors[json_last_error()]."')."); |
|
| 40 | 40 | } else { |
| 41 | 41 | $error = false; |
| 42 | 42 | $messageParts = array(); |
@@ -53,14 +53,14 @@ discard block |
||
| 53 | 53 | $error = true; |
| 54 | 54 | $errorMessage = ''; |
| 55 | 55 | foreach ($validator->getErrors() as $error) { |
| 56 | - $errorMessage = $errorMessage . sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
| 56 | + $errorMessage = $errorMessage.sprintf("[%s] %s\n", $error['property'], $error['message']); |
|
| 57 | 57 | } |
| 58 | - $messageParts[] = $jsonSchemaFile['jsonschemafilename'] . ' - ' . $jsonSchemaFile['jsonschemafileurl'] . '(last error: ' . $errorMessage . ').'; |
|
| 58 | + $messageParts[] = $jsonSchemaFile['jsonschemafilename'].' - '.$jsonSchemaFile['jsonschemafileurl'].'(last error: '.$errorMessage.').'; |
|
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | if ($error === true) { |
| 63 | - $message = 'JSON file (' . (string) $response->getUri() . ') does not validate against the following JSON Schema files: ' . implode(', ', $messageParts); |
|
| 63 | + $message = 'JSON file ('.(string) $response->getUri().') does not validate against the following JSON Schema files: '.implode(', ', $messageParts); |
|
| 64 | 64 | throw new ValidationFailedException($message); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | if (($response->getStatus() < 300 || $response->getStatus() >= 400) && $response->getContentType() === 'text/html') { |
| 17 | 17 | if (stripos($response->getBody(), '</html>') === false) { |
| 18 | - throw new ValidationFailedException('Closing html tag is missing (document lengh: ' . strlen($response->getBody()) . ').'); |
|
| 18 | + throw new ValidationFailedException('Closing html tag is missing (document lengh: '.strlen($response->getBody()).').'); |
|
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function validate(Response $response) |
| 26 | 26 | { |
| 27 | 27 | if ($response->getDuration() > $this->maxDuration) { |
| 28 | - throw new ValidationFailedException('The http request took ' . $response->getDuration() . ' milliseconds (limit was ' . $this->maxDuration . 'ms). '); |
|
| 28 | + throw new ValidationFailedException('The http request took '.$response->getDuration().' milliseconds (limit was '.$this->maxDuration.'ms). '); |
|
| 29 | 29 | } |
| 30 | 30 | } |
| 31 | 31 | } |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | $this->sessionContainer = new SessionContainer(); |
| 21 | 21 | |
| 22 | 22 | foreach ($sessions as $sessionName => $session) { |
| 23 | - $command = $this->executable . " '" . json_encode($session) . "'"; |
|
| 23 | + $command = $this->executable." '".json_encode($session)."'"; |
|
| 24 | 24 | |
| 25 | 25 | exec($command, $output, $return); |
| 26 | 26 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | private function getEndpoint(Uri $uri) |
| 15 | 15 | { |
| 16 | 16 | // return str_replace('#url#', urlencode('https://webhook.koalamon.com'), self::ENDPOINT); |
| 17 | - return str_replace('#url#', urlencode((string)$uri), self::ENDPOINT); |
|
| 17 | + return str_replace('#url#', urlencode((string) $uri), self::ENDPOINT); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function validate(Response $response) |
@@ -33,13 +33,13 @@ discard block |
||
| 33 | 33 | ))); |
| 34 | 34 | |
| 35 | 35 | if (property_exists($result, "error")) { |
| 36 | - throw new ValidationFailedException('Google mobile friendly test was not passed. Error "' . $result->error->message . '"'); |
|
| 36 | + throw new ValidationFailedException('Google mobile friendly test was not passed. Error "'.$result->error->message.'"'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | $passResult = $result->ruleGroups->USABILITY; |
| 40 | 40 | |
| 41 | 41 | if (!$passResult->pass) { |
| 42 | - throw new ValidationFailedException('Google mobile friendly test was not passed. Score ' . $passResult->score . '/100.'); |
|
| 42 | + throw new ValidationFailedException('Google mobile friendly test was not passed. Score '.$passResult->score.'/100.'); |
|
| 43 | 43 | } |
| 44 | 44 | } |
| 45 | 45 | } |