@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | public function addClass($name) |
19 | 19 | { |
20 | 20 | $elements = $this->get('classes'); |
21 | - $elements[] = (string)$name; |
|
21 | + $elements[] = (string) $name; |
|
22 | 22 | $this->set('classes', $elements); |
23 | 23 | } |
24 | 24 | |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | public function setAbstraction($abstraction) |
27 | 27 | { |
28 | 28 | if ($abstraction !== null) { |
29 | - $abstraction = (float)$abstraction; |
|
29 | + $abstraction = (float) $abstraction; |
|
30 | 30 | } |
31 | 31 | $this->set('abstraction', $abstraction); |
32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | public function setInstability($instability) |
42 | 42 | { |
43 | 43 | if ($instability !== null) { |
44 | - $instability = (float)$instability; |
|
44 | + $instability = (float) $instability; |
|
45 | 45 | } |
46 | 46 | $this->set('instability', $instability); |
47 | 47 | } |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | } |
64 | 64 | $classDependencies = $this->getOutgoingClassDependencies(); |
65 | 65 | $packageDependencies = $this->getOutgoingPackageDependencies(); |
66 | - if (! in_array($className, $classDependencies)) { |
|
66 | + if (!in_array($className, $classDependencies)) { |
|
67 | 67 | $classDependencies[] = $className; |
68 | 68 | $this->set('outgoing_class_dependencies', $classDependencies); |
69 | 69 | } |
70 | - if (! in_array($packageName, $packageDependencies)) { |
|
70 | + if (!in_array($packageName, $packageDependencies)) { |
|
71 | 71 | $packageDependencies[] = $packageName; |
72 | 72 | $this->set('outgoing_package_dependencies', $packageDependencies); |
73 | 73 | } |
@@ -96,11 +96,11 @@ discard block |
||
96 | 96 | } |
97 | 97 | $classDependencies = $this->getIncomingClassDependencies(); |
98 | 98 | $packageDependencies = $this->getIncomingPackageDependencies(); |
99 | - if (! in_array($className, $classDependencies)) { |
|
99 | + if (!in_array($className, $classDependencies)) { |
|
100 | 100 | $classDependencies[] = $className; |
101 | 101 | $this->set('incoming_class_dependencies', $classDependencies); |
102 | 102 | } |
103 | - if (! in_array($packageName, $packageDependencies)) { |
|
103 | + if (!in_array($packageName, $packageDependencies)) { |
|
104 | 104 | $packageDependencies[] = $packageName; |
105 | 105 | $this->set('incoming_package_dependencies', $packageDependencies); |
106 | 106 | } |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | $consolidated = new Consolidated($metrics); |
42 | 42 | |
43 | 43 | // history of builds |
44 | - $today = (object)[ |
|
44 | + $today = (object) [ |
|
45 | 45 | 'avg' => $consolidated->getAvg(), |
46 | 46 | 'sum' => $consolidated->getSum() |
47 | 47 | ]; |
48 | - $files = glob($logDir . '/js/history-*.json'); |
|
48 | + $files = glob($logDir.'/js/history-*.json'); |
|
49 | 49 | $next = count($files) + 1; |
50 | 50 | $history = []; |
51 | 51 | natsort($files); |
@@ -54,39 +54,39 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // copy sources |
57 | - if (!file_exists($logDir . '/js')) { |
|
58 | - mkdir($logDir . '/js', 0755, true); |
|
57 | + if (!file_exists($logDir.'/js')) { |
|
58 | + mkdir($logDir.'/js', 0755, true); |
|
59 | 59 | } |
60 | - if (!file_exists($logDir . '/css')) { |
|
61 | - mkdir($logDir . '/css', 0755, true); |
|
60 | + if (!file_exists($logDir.'/css')) { |
|
61 | + mkdir($logDir.'/css', 0755, true); |
|
62 | 62 | } |
63 | - if (!file_exists($logDir . '/images')) { |
|
64 | - mkdir($logDir . '/images', 0755, true); |
|
63 | + if (!file_exists($logDir.'/images')) { |
|
64 | + mkdir($logDir.'/images', 0755, true); |
|
65 | 65 | } |
66 | - if (!file_exists($logDir . '/fonts')) { |
|
67 | - mkdir($logDir . '/fonts', 0755, true); |
|
66 | + if (!file_exists($logDir.'/fonts')) { |
|
67 | + mkdir($logDir.'/fonts', 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'); |
|
72 | - recurse_copy(__DIR__ . '/template/fonts', $logDir . '/fonts'); |
|
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 | + recurse_copy(__DIR__.'/template/fonts', $logDir.'/fonts'); |
|
73 | 73 | |
74 | 74 | // render dynamic pages |
75 | - $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history); |
|
76 | - $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
77 | - $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
78 | - $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
79 | - $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history); |
|
80 | - $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
81 | - $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
82 | - $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
83 | - $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
84 | - $this->renderPage(__DIR__ . '/template/packages.php', $logDir . '/packages.html', $consolidated, $history); |
|
85 | - $this->renderPage(__DIR__ . '/template/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history); |
|
75 | + $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history); |
|
76 | + $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
77 | + $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
78 | + $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
79 | + $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history); |
|
80 | + $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
81 | + $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
82 | + $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
83 | + $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
84 | + $this->renderPage(__DIR__.'/template/packages.php', $logDir.'/packages.html', $consolidated, $history); |
|
85 | + $this->renderPage(__DIR__.'/template/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history); |
|
86 | 86 | if ($this->config->has('git')) { |
87 | - $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history); |
|
87 | + $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history); |
|
88 | 88 | } |
89 | - $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
89 | + $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
90 | 90 | |
91 | 91 | // js data |
92 | 92 | file_put_contents( |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | |
101 | 101 | // json data |
102 | 102 | file_put_contents( |
103 | - $logDir . '/js/classes.js', |
|
104 | - 'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
103 | + $logDir.'/js/classes.js', |
|
104 | + 'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT) |
|
105 | 105 | ); |
106 | 106 | |
107 | 107 | $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'; |