@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $this->config = $config; |
56 | 56 | $this->output = $output; |
57 | - $this->templateDir = __DIR__ . '/../../../../templates'; |
|
57 | + $this->templateDir = __DIR__.'/../../../../templates'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | $consolidated = new Consolidated($metrics); |
80 | 80 | |
81 | 81 | // history of builds |
82 | - $today = (object)[ |
|
82 | + $today = (object) [ |
|
83 | 83 | 'avg' => $consolidated->getAvg(), |
84 | 84 | 'sum' => $consolidated->getSum() |
85 | 85 | ]; |
86 | - $files = glob($logDir . '/js/history-*.json'); |
|
86 | + $files = glob($logDir.'/js/history-*.json'); |
|
87 | 87 | $next = count($files) + 1; |
88 | 88 | $history = []; |
89 | 89 | natsort($files); |
@@ -92,45 +92,45 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | // copy sources |
95 | - if (!file_exists($logDir . '/js')) { |
|
96 | - mkdir($logDir . '/js', 0755, true); |
|
95 | + if (!file_exists($logDir.'/js')) { |
|
96 | + mkdir($logDir.'/js', 0755, true); |
|
97 | 97 | } |
98 | - if (!file_exists($logDir . '/css')) { |
|
99 | - mkdir($logDir . '/css', 0755, true); |
|
98 | + if (!file_exists($logDir.'/css')) { |
|
99 | + mkdir($logDir.'/css', 0755, true); |
|
100 | 100 | } |
101 | - if (!file_exists($logDir . '/images')) { |
|
102 | - mkdir($logDir . '/images', 0755, true); |
|
101 | + if (!file_exists($logDir.'/images')) { |
|
102 | + mkdir($logDir.'/images', 0755, true); |
|
103 | 103 | } |
104 | - if (!file_exists($logDir . '/fonts')) { |
|
105 | - mkdir($logDir . '/fonts', 0755, true); |
|
104 | + if (!file_exists($logDir.'/fonts')) { |
|
105 | + mkdir($logDir.'/fonts', 0755, true); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (!is_writable($logDir)) { |
109 | 109 | throw new RuntimeExceptionAlias(sprintf('Unable to write in the directory "%s"', $logDir)); |
110 | 110 | } |
111 | 111 | |
112 | - recurse_copy($this->templateDir . '/html_report/js', $logDir . '/js'); |
|
113 | - recurse_copy($this->templateDir . '/html_report/css', $logDir . '/css'); |
|
114 | - recurse_copy($this->templateDir . '/html_report/images', $logDir . '/images'); |
|
115 | - recurse_copy($this->templateDir . '/html_report/fonts', $logDir . '/fonts'); |
|
112 | + recurse_copy($this->templateDir.'/html_report/js', $logDir.'/js'); |
|
113 | + recurse_copy($this->templateDir.'/html_report/css', $logDir.'/css'); |
|
114 | + recurse_copy($this->templateDir.'/html_report/images', $logDir.'/images'); |
|
115 | + recurse_copy($this->templateDir.'/html_report/fonts', $logDir.'/fonts'); |
|
116 | 116 | |
117 | 117 | // render dynamic pages |
118 | - $this->renderPage($this->templateDir . '/html_report/index.php', $logDir . '/index.html', $consolidated, $history); |
|
119 | - $this->renderPage($this->templateDir . '/html_report/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
120 | - $this->renderPage($this->templateDir . '/html_report/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
121 | - $this->renderPage($this->templateDir . '/html_report/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
122 | - $this->renderPage($this->templateDir . '/html_report/all.php', $logDir . '/all.html', $consolidated, $history); |
|
123 | - $this->renderPage($this->templateDir . '/html_report/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
124 | - $this->renderPage($this->templateDir . '/html_report/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
125 | - $this->renderPage($this->templateDir . '/html_report/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
126 | - $this->renderPage($this->templateDir . '/html_report/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
127 | - $this->renderPage($this->templateDir . '/html_report/packages.php', $logDir . '/packages.html', $consolidated, $history); |
|
128 | - $this->renderPage($this->templateDir . '/html_report/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history); |
|
129 | - $this->renderPage($this->templateDir . '/html_report/composer.php', $logDir . '/composer.html', $consolidated, $history); |
|
118 | + $this->renderPage($this->templateDir.'/html_report/index.php', $logDir.'/index.html', $consolidated, $history); |
|
119 | + $this->renderPage($this->templateDir.'/html_report/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
120 | + $this->renderPage($this->templateDir.'/html_report/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
121 | + $this->renderPage($this->templateDir.'/html_report/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
122 | + $this->renderPage($this->templateDir.'/html_report/all.php', $logDir.'/all.html', $consolidated, $history); |
|
123 | + $this->renderPage($this->templateDir.'/html_report/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
124 | + $this->renderPage($this->templateDir.'/html_report/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
125 | + $this->renderPage($this->templateDir.'/html_report/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
126 | + $this->renderPage($this->templateDir.'/html_report/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
127 | + $this->renderPage($this->templateDir.'/html_report/packages.php', $logDir.'/packages.html', $consolidated, $history); |
|
128 | + $this->renderPage($this->templateDir.'/html_report/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history); |
|
129 | + $this->renderPage($this->templateDir.'/html_report/composer.php', $logDir.'/composer.html', $consolidated, $history); |
|
130 | 130 | if ($this->config->has('git')) { |
131 | - $this->renderPage($this->templateDir . '/html_report/git.php', $logDir . '/git.html', $consolidated, $consolidatedGroups, $history); |
|
131 | + $this->renderPage($this->templateDir.'/html_report/git.php', $logDir.'/git.html', $consolidated, $consolidatedGroups, $history); |
|
132 | 132 | } |
133 | - $this->renderPage($this->templateDir . '/html_report/junit.php', $logDir . '/junit.html', $consolidated, $consolidatedGroups, $history); |
|
133 | + $this->renderPage($this->templateDir.'/html_report/junit.php', $logDir.'/junit.html', $consolidated, $consolidatedGroups, $history); |
|
134 | 134 | |
135 | 135 | // js data |
136 | 136 | file_put_contents( |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | |
145 | 145 | // json data |
146 | 146 | file_put_contents( |
147 | - $logDir . '/classes.js', |
|
148 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
147 | + $logDir.'/classes.js', |
|
148 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
149 | 149 | ); |
150 | 150 | |
151 | 151 | // HTML files to generate |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | |
167 | 167 | // consolidated by groups |
168 | 168 | foreach ($consolidatedGroups as $name => $consolidated) { |
169 | - $outDir = $logDir . DIRECTORY_SEPARATOR . $name; |
|
169 | + $outDir = $logDir.DIRECTORY_SEPARATOR.$name; |
|
170 | 170 | $this->currentGroup = $name; |
171 | 171 | $this->assetPath = '../'; |
172 | 172 | |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | ); |
184 | 184 | |
185 | 185 | file_put_contents( |
186 | - $outDir . '/classes.js', |
|
187 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
186 | + $outDir.'/classes.js', |
|
187 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
188 | 188 | ); |
189 | 189 | } |
190 | 190 | } |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | $diff = $newValue - $oldValue; |
263 | 263 | if ($diff > 0) { |
264 | - $diff = '+' . $diff; |
|
264 | + $diff = '+'.$diff; |
|
265 | 265 | } |
266 | 266 | |
267 | 267 | $goodOrBad = 'neutral'; |