@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Analyze constructor. |
51 | - * @param OutputInterface $output |
|
51 | + * @param Output $output |
|
52 | 52 | */ |
53 | 53 | public function __construct(Config $config, Output $output, Issuer $issuer) |
54 | 54 | { |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Issuer constructor. |
35 | - * @param OutputInterface $output |
|
35 | + * @param Output $output |
|
36 | 36 | */ |
37 | 37 | public function __construct(Output $output) |
38 | 38 | { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | - * @param $status |
|
133 | + * @param integer $status |
|
134 | 134 | */ |
135 | 135 | protected function terminate($status) |
136 | 136 | { |
@@ -139,6 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | /** |
141 | 141 | * @param $log |
142 | + * @param string $logfile |
|
142 | 143 | * @return $this |
143 | 144 | */ |
144 | 145 | protected function log($logfile, $log) |
@@ -152,7 +153,7 @@ discard block |
||
152 | 153 | } |
153 | 154 | |
154 | 155 | /** |
155 | - * @param $debugKey |
|
156 | + * @param string $debugKey |
|
156 | 157 | * @param $value |
157 | 158 | * @return $this |
158 | 159 | */ |
@@ -163,7 +164,7 @@ discard block |
||
163 | 164 | } |
164 | 165 | |
165 | 166 | /** |
166 | - * @param $debugKey |
|
167 | + * @param string $debugKey |
|
167 | 168 | * @return $this |
168 | 169 | */ |
169 | 170 | public function clear($debugKey) |
@@ -22,7 +22,7 @@ |
||
22 | 22 | /** |
23 | 23 | * Reporter constructor. |
24 | 24 | * @param Config $config |
25 | - * @param OutputInterface $output |
|
25 | + * @param Output $output |
|
26 | 26 | */ |
27 | 27 | public function __construct(Config $config, Output $output) |
28 | 28 | { |
@@ -4,7 +4,6 @@ |
||
4 | 4 | use Hal\Application\Config\Config; |
5 | 5 | use Hal\Component\Output\Output; |
6 | 6 | use Hal\Metric\Consolidated; |
7 | -use Hal\Metric\Consolided; |
|
8 | 7 | use Hal\Metric\Metrics; |
9 | 8 | |
10 | 9 | class Reporter |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | $consolidated = new Consolidated($metrics); |
45 | 45 | |
46 | 46 | // history of builds |
47 | - $today = (object)[ |
|
47 | + $today = (object) [ |
|
48 | 48 | 'avg' => $consolidated->getAvg(), |
49 | 49 | 'sum' => $consolidated->getSum() |
50 | 50 | ]; |
51 | - $files = glob($logDir . '/js/history-*.json'); |
|
51 | + $files = glob($logDir.'/js/history-*.json'); |
|
52 | 52 | $next = sizeof($files) + 1; |
53 | 53 | $history = []; |
54 | 54 | natsort($files); |
@@ -57,34 +57,34 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // copy sources |
60 | - if(!file_exists($logDir . '/js')) { |
|
60 | + if (!file_exists($logDir.'/js')) { |
|
61 | 61 | mkdir($logDir.'/js', 0755, true); |
62 | 62 | } |
63 | - if(!file_exists($logDir . '/css')) { |
|
63 | + if (!file_exists($logDir.'/css')) { |
|
64 | 64 | mkdir($logDir.'/css', 0755, true); |
65 | 65 | } |
66 | - if(!file_exists($logDir . '/images')) { |
|
66 | + if (!file_exists($logDir.'/images')) { |
|
67 | 67 | mkdir($logDir.'/images', 0755, true); |
68 | 68 | } |
69 | - recurse_copy(__DIR__ . '/template/js', $logDir . '/js'); |
|
70 | - recurse_copy(__DIR__ . '/template/css', $logDir . '/css'); |
|
71 | - recurse_copy(__DIR__ . '/template/images', $logDir . '/images'); |
|
69 | + recurse_copy(__DIR__.'/template/js', $logDir.'/js'); |
|
70 | + recurse_copy(__DIR__.'/template/css', $logDir.'/css'); |
|
71 | + recurse_copy(__DIR__.'/template/images', $logDir.'/images'); |
|
72 | 72 | |
73 | 73 | // render dynamic pages |
74 | - $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history); |
|
75 | - $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
76 | - $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
77 | - $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
78 | - $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history); |
|
79 | - $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
80 | - $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
81 | - $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
82 | - $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
74 | + $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history); |
|
75 | + $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
76 | + $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
77 | + $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
78 | + $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history); |
|
79 | + $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
80 | + $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
81 | + $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
82 | + $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
83 | 83 | if ($this->config->has('git')) { |
84 | - $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history); |
|
84 | + $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history); |
|
85 | 85 | } |
86 | 86 | if ($this->config->has('junit')) { |
87 | - $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
87 | + $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | // js data |
@@ -99,8 +99,8 @@ discard block |
||
99 | 99 | |
100 | 100 | // json data |
101 | 101 | file_put_contents( |
102 | - $logDir . '/js/classes.js', |
|
103 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
102 | + $logDir.'/js/classes.js', |
|
103 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
104 | 104 | ); |
105 | 105 | |
106 | 106 | $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir)); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $diff = $newValue - $oldValue; |
170 | 170 | if ($diff > 0) { |
171 | - $diff = '+' . $diff; |
|
171 | + $diff = '+'.$diff; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | $goodOrBad = 'neutral'; |
@@ -3,7 +3,6 @@ |
||
3 | 3 | |
4 | 4 | use Hal\Application\Config\Config; |
5 | 5 | use Hal\Component\Output\Output; |
6 | -use Hal\Metric\Consolided; |
|
7 | 6 | use Hal\Metric\Metrics; |
8 | 7 | use Hal\Violation\Violation; |
9 | 8 |
@@ -18,9 +18,9 @@ |
||
18 | 18 | * @package Hal\Component\Issue |
19 | 19 | */ |
20 | 20 | /** |
21 | - * Class ProgressBar |
|
22 | - * @package Hal\Component\Output |
|
23 | - */ |
|
21 | + * Class ProgressBar |
|
22 | + * @package Hal\Component\Output |
|
23 | + */ |
|
24 | 24 | class ProgressBar |
25 | 25 | { |
26 | 26 |
@@ -97,7 +97,7 @@ |
||
97 | 97 | if (DIRECTORY_SEPARATOR === '\\') { |
98 | 98 | return |
99 | 99 | 0 >= version_compare('10.0.10586', |
100 | - PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD) |
|
100 | + PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD) |
|
101 | 101 | || false !== getenv('ANSICON') |
102 | 102 | || 'ON' === getenv('ConEmuANSI') |
103 | 103 | || 'xterm' === getenv('TERM'); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function writeln($message) |
25 | 25 | { |
26 | - $this->write(PHP_EOL . $message); |
|
26 | + $this->write(PHP_EOL.$message); |
|
27 | 27 | return $this; |
28 | 28 | } |
29 | 29 |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | */ |
26 | 26 | public function writeln($message) |
27 | 27 | { |
28 | - $this->write(PHP_EOL . $message); |
|
28 | + $this->write(PHP_EOL.$message); |
|
29 | 29 | return $this; |
30 | 30 | } |
31 | 31 | |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function write($message) |
36 | 36 | { |
37 | - $this->quietMode||file_put_contents('php://stdout', $message); |
|
37 | + $this->quietMode || file_put_contents('php://stdout', $message); |
|
38 | 38 | return $this; |
39 | 39 | } |
40 | 40 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | $output = new CliOutput(); |
24 | 24 | |
25 | 25 | // issues and debug |
26 | - $issuer = (new Issuer($output));//->enable(); |
|
26 | + $issuer = (new Issuer($output)); //->enable(); |
|
27 | 27 | |
28 | 28 | // config |
29 | 29 | $config = (new Parser())->parse($argv); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // analyze |
58 | 58 | try { |
59 | 59 | $metrics = (new Analyze($config, $output, $issuer))->run($files); |
60 | - }catch(ConfigException $e) { |
|
60 | + } catch (ConfigException $e) { |
|
61 | 61 | $output->writeln(sprintf('<error>%s</error>', $e->getMessage())); |
62 | 62 | exit(1); |
63 | 63 | } |