@@ -2,8 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace whm\Smoke\Rules\Xml\Rss; |
| 4 | 4 | |
| 5 | -use Anh\FeedBuilder\FeedBuilder; |
|
| 6 | -use Fungku\MarkupValidator\FeedValidator; |
|
| 7 | 5 | use phm\HttpWebdriverClient\Http\Response\UriAwareResponse; |
| 8 | 6 | use Psr\Http\Message\ResponseInterface; |
| 9 | 7 | use whm\Smoke\Rules\CheckResult; |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | private function getSchema() |
| 25 | 25 | { |
| 26 | - return __DIR__ . '/' . self::SCHEMA; |
|
| 26 | + return __DIR__.'/'.self::SCHEMA; |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | public function doValidation(ResponseInterface $response) |
| 30 | 30 | { |
| 31 | - $body = (string)$response->getBody(); |
|
| 31 | + $body = (string) $response->getBody(); |
|
| 32 | 32 | |
| 33 | 33 | if (preg_match('/<rss/', $body)) { |
| 34 | 34 | libxml_clear_errors(); |
@@ -38,8 +38,8 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | if ($lastError) { |
| 40 | 40 | throw new ValidationFailedException( |
| 41 | - 'The given xml file is not well formed (last error: ' . |
|
| 42 | - str_replace("\n", '', $lastError->message) . ').'); |
|
| 41 | + 'The given xml file is not well formed (last error: '. |
|
| 42 | + str_replace("\n", '', $lastError->message).').'); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | $valid = @$dom->schemaValidate($this->getSchema()); |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | $lastErrorMessage = str_replace("\n", '', $lastError->message); |
| 50 | 50 | |
| 51 | 51 | if ($response instanceof UriAwareResponse) { |
| 52 | - $toolUrl = sprintf(self::PUBLIC_SERVICE, urlencode((string)$response->getUri())); |
|
| 52 | + $toolUrl = sprintf(self::PUBLIC_SERVICE, urlencode((string) $response->getUri())); |
|
| 53 | 53 | } else { |
| 54 | 54 | $toolUrl = ''; |
| 55 | 55 | } |
| 56 | - return new CheckResult(CheckResult::STATUS_FAILURE, 'The given xml file is not a valid rss file (last error: ' . $lastErrorMessage . ').', null, $toolUrl); |
|
| 56 | + return new CheckResult(CheckResult::STATUS_FAILURE, 'The given xml file is not a valid rss file (last error: '.$lastErrorMessage.').', null, $toolUrl); |
|
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | return new CheckResult(CheckResult::STATUS_SUCCESS, 'The given rss file is valid.'); |