@@ -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 | { |
@@ -71,7 +72,7 @@ discard block |
||
71 | 72 | } |
72 | 73 | |
73 | 74 | /** |
74 | - * @return mixed |
|
75 | + * @return string |
|
75 | 76 | */ |
76 | 77 | public function getMessage() |
77 | 78 | { |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | |
22 | 22 | private function getSchema() |
23 | 23 | { |
24 | - return __DIR__ . '/' . self::SCHEMA; |
|
24 | + return __DIR__.'/'.self::SCHEMA; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function doValidation(ResponseInterface $response) |
28 | 28 | { |
29 | - $body = (string)$response->getBody(); |
|
29 | + $body = (string) $response->getBody(); |
|
30 | 30 | |
31 | 31 | if (preg_match('/<rss/', $body)) { |
32 | 32 | libxml_clear_errors(); |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | $lastError = libxml_get_last_error(); |
36 | 36 | if ($lastError) { |
37 | 37 | throw new ValidationFailedException( |
38 | - 'The given xml file is not well formed (last error: ' . |
|
39 | - str_replace("\n", '', $lastError->message) . ').'); |
|
38 | + 'The given xml file is not well formed (last error: '. |
|
39 | + str_replace("\n", '', $lastError->message).').'); |
|
40 | 40 | } |
41 | 41 | $valid = @$dom->schemaValidate($this->getSchema()); |
42 | 42 | if (!$valid) { |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $lastErrorMessage = str_replace("\n", '', $lastError->message); |
45 | 45 | |
46 | 46 | if ($response instanceof UriAwareResponse) { |
47 | - $toolUrl = sprintf(self::PUBLIC_SERVICE, urlencode((string)$response->getUri())); |
|
47 | + $toolUrl = sprintf(self::PUBLIC_SERVICE, urlencode((string) $response->getUri())); |
|
48 | 48 | } else { |
49 | 49 | $toolUrl = ''; |
50 | 50 | } |
51 | - return new CheckResult(CheckResult::STATUS_FAILURE, 'The given xml file is not a valid rss file (last error: ' . $lastErrorMessage . ').', null, $toolUrl); |
|
51 | + return new CheckResult(CheckResult::STATUS_FAILURE, 'The given xml file is not a valid rss file (last error: '.$lastErrorMessage.').', null, $toolUrl); |
|
52 | 52 | } |
53 | 53 | } |
54 | 54 | return new CheckResult(CheckResult::STATUS_SUCCESS, 'The given rss file is valid.'); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $configArray = $this->getConfigArray($configFile, true); |
51 | 51 | |
52 | 52 | if (is_string($configArray)) { |
53 | - throw new \RuntimeException('Unable to load config file. Please check ' . $configFile); |
|
53 | + throw new \RuntimeException('Unable to load config file. Please check '.$configFile); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $this->config = new Configuration(new Uri('http://www.example.com'), $dispatcher, $configArray); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use Symfony\Component\Console\Output\OutputInterface; |
6 | 6 | use whm\Smoke\Config\Configuration; |
7 | -use whm\Smoke\Extensions\SmokeResponseRetriever\Retriever\Retriever; |
|
8 | 7 | use whm\Smoke\Rules\CheckResult; |
9 | 8 | |
10 | 9 |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | $this->resultFile = $resultFile; |
29 | 29 | |
30 | 30 | if ($templateDir === null) { |
31 | - $this->templateDir = __DIR__ . '/templates'; |
|
31 | + $this->templateDir = __DIR__.'/templates'; |
|
32 | 32 | } else { |
33 | 33 | $this->templateDir = $templateDir; |
34 | 34 | } |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | if (!file_put_contents($this->resultFile, $html)) { |
69 | - $this->output->writeln("<error>HTML Reporter extension: Could not write result file to " . $this->resultFile ."</error>"); |
|
69 | + $this->output->writeln("<error>HTML Reporter extension: Could not write result file to ".$this->resultFile."</error>"); |
|
70 | 70 | } else { |
71 | - $this->output->writeln("<info>HTML Reporter extension:</info> Result file written to " . $this->resultFile); |
|
71 | + $this->output->writeln("<info>HTML Reporter extension:</info> Result file written to ".$this->resultFile); |
|
72 | 72 | } |
73 | 73 | } |
74 | 74 |
@@ -106,13 +106,13 @@ |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * @param $identifier |
|
110 | - * @param $system |
|
111 | - * @param $message |
|
109 | + * @param string $identifier |
|
110 | + * @param string $system |
|
111 | + * @param string $message |
|
112 | 112 | * @param $status |
113 | - * @param $value |
|
114 | - * @param $tool |
|
115 | - * @param $component |
|
113 | + * @param integer $value |
|
114 | + * @param string $tool |
|
115 | + * @param string $component |
|
116 | 116 | * @param Attribute[] $attributes |
117 | 117 | */ |
118 | 118 | private function send($identifier, $system, $message, $status, $value, $tool, $component, $attributes = [], $url = "") |
@@ -4,7 +4,6 @@ discard block |
||
4 | 4 | |
5 | 5 | use Koalamon\Client\Reporter\Event; |
6 | 6 | use Koalamon\Client\Reporter\Event\Attribute; |
7 | -use Koalamon\Client\Reporter\Event\Processor\MongoDBProcessor; |
|
8 | 7 | use Koalamon\Client\Reporter\KoalamonException; |
9 | 8 | use Koalamon\Client\Reporter\Reporter as KoalaReporter; |
10 | 9 | use Symfony\Component\Console\Output\OutputInterface; |
@@ -12,7 +11,6 @@ discard block |
||
12 | 11 | use whm\Smoke\Extensions\Leankoala\LeankoalaExtension; |
13 | 12 | use whm\Smoke\Extensions\SmokeResponseRetriever\Retriever\Retriever; |
14 | 13 | use whm\Smoke\Rules\CheckResult; |
15 | -use whm\Smoke\Scanner\Result; |
|
16 | 14 | |
17 | 15 | class KoalamonSummaryReporter implements Reporter |
18 | 16 | { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | const STATUS_SUCCESS = 'success'; |
53 | 53 | const STATUS_FAILURE = 'failure'; |
54 | 54 | |
55 | - public function init($apiKey, Configuration $_configuration, OutputInterface $_output, $server = 'https://webhook.koalamon.com', $system = '', $identifier = '', $tool = '', $url ='') |
|
55 | + public function init($apiKey, Configuration $_configuration, OutputInterface $_output, $server = 'https://webhook.koalamon.com', $system = '', $identifier = '', $tool = '', $url = '') |
|
56 | 56 | { |
57 | 57 | $httpClient = new \GuzzleHttp\Client(); |
58 | 58 | |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | public function processResults($results) |
83 | 83 | { |
84 | 84 | foreach ($results as $result) { |
85 | - if($result->getStatus() == CheckResult::STATUS_SUCCESS) { |
|
85 | + if ($result->getStatus() == CheckResult::STATUS_SUCCESS) { |
|
86 | 86 | $this->success++; |
87 | 87 | } else { |
88 | 88 | $this->failed++; |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | public function finish() |
94 | 94 | { |
95 | 95 | $message = 'Checks: '; |
96 | - $message .= $this->success . ' succeeded, '; |
|
97 | - $message .= $this->failed . ' failed. '; |
|
96 | + $message .= $this->success.' succeeded, '; |
|
97 | + $message .= $this->failed.' failed. '; |
|
98 | 98 | |
99 | 99 | if ($this->failed > 0) { |
100 | 100 | $status = Event::STATUS_FAILURE; |
@@ -129,8 +129,8 @@ discard block |
||
129 | 129 | $this->reporter->sendEvent($event); |
130 | 130 | } catch (KoalamonException $e) { |
131 | 131 | $this->output->writeln("\n <error> Error sending result to leankoala. </error>"); |
132 | - $this->output->writeln(' Url: ' . $e->getUrl()); |
|
133 | - $this->output->writeln(' Payload: ' . $e->getPayload()); |
|
132 | + $this->output->writeln(' Url: '.$e->getUrl()); |
|
133 | + $this->output->writeln(' Payload: '.$e->getPayload()); |
|
134 | 134 | $this->output->writeln(""); |
135 | 135 | } catch (\Exception $e) { |
136 | 136 | $this->output->writeln($e->getMessage()); |