@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // get latest version |
37 | 37 | $latest = '0.0.0'; |
38 | - foreach ((array)$json->package->versions as $version => $datas) { |
|
38 | + foreach ((array) $json->package->versions as $version => $datas) { |
|
39 | 39 | $version = \preg_replace('([^\.\d])', '', $version); |
40 | 40 | if (!\preg_match('!\d+\.\d+\.\d+!', $version)) { |
41 | 41 | continue; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | // build a fingerprint of the given method |
51 | 51 | $fingerprintOfMethod = []; |
52 | - \iterate_over_node($node, function ($node) use (&$fingerprintOfMethod) { |
|
52 | + \iterate_over_node($node, function($node) use (&$fingerprintOfMethod) { |
|
53 | 53 | |
54 | 54 | // avoid cast |
55 | 55 | if ($node instanceof Cast) { |
@@ -17,7 +17,6 @@ |
||
17 | 17 | public static function getName(Node $node) |
18 | 18 | { |
19 | 19 | return ($node instanceof Node\Stmt\Class_ && $node->isAnonymous()) ? |
20 | - 'anonymous@' . \spl_object_hash($node) : |
|
21 | - $node->namespacedName->toString(); |
|
20 | + 'anonymous@'.\spl_object_hash($node) : $node->namespacedName->toString(); |
|
22 | 21 | } |
23 | 22 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | return; |
51 | 51 | } |
52 | 52 | if (!\file_exists(\dirname($logFile)) || !\is_writable(\dirname($logFile))) { |
53 | - throw new \RuntimeException('You don\'t have permissions to write JSON report in ' . $logFile); |
|
53 | + throw new \RuntimeException('You don\'t have permissions to write JSON report in '.$logFile); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | \file_put_contents($logFile, \json_encode($metrics, \JSON_PRETTY_PRINT)); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | return; |
54 | 54 | } |
55 | 55 | if (!\file_exists(\dirname($logFile)) || !\is_writable(\dirname($logFile))) { |
56 | - throw new \RuntimeException('You don\'t have permissions to write CSV report in ' . $logFile); |
|
56 | + throw new \RuntimeException('You don\'t have permissions to write CSV report in '.$logFile); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | $availables = (new Registry())->allForStructures(); |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | $consolidated = new Consolidated($metrics); |
52 | 52 | |
53 | 53 | // history of builds |
54 | - $today = (object)[ |
|
54 | + $today = (object) [ |
|
55 | 55 | 'avg' => $consolidated->getAvg(), |
56 | 56 | 'sum' => $consolidated->getSum() |
57 | 57 | ]; |
58 | - $files = \glob($logDir . '/js/history-*.json'); |
|
58 | + $files = \glob($logDir.'/js/history-*.json'); |
|
59 | 59 | $next = \count($files) + 1; |
60 | 60 | $history = []; |
61 | 61 | \natsort($files); |
@@ -64,37 +64,37 @@ discard block |
||
64 | 64 | } |
65 | 65 | |
66 | 66 | // copy sources |
67 | - if (!\file_exists($logDir . '/js')) { |
|
67 | + if (!\file_exists($logDir.'/js')) { |
|
68 | 68 | \mkdir($logDir.'/js', 0755, true); |
69 | 69 | } |
70 | - if (!\file_exists($logDir . '/css')) { |
|
70 | + if (!\file_exists($logDir.'/css')) { |
|
71 | 71 | \mkdir($logDir.'/css', 0755, true); |
72 | 72 | } |
73 | - if (!\file_exists($logDir . '/images')) { |
|
73 | + if (!\file_exists($logDir.'/images')) { |
|
74 | 74 | \mkdir($logDir.'/images', 0755, true); |
75 | 75 | } |
76 | - if (!\file_exists($logDir . '/fonts')) { |
|
76 | + if (!\file_exists($logDir.'/fonts')) { |
|
77 | 77 | \mkdir($logDir.'/fonts', 0755, true); |
78 | 78 | } |
79 | - \recurse_copy(__DIR__ . '/template/js', $logDir . '/js'); |
|
80 | - \recurse_copy(__DIR__ . '/template/css', $logDir . '/css'); |
|
81 | - \recurse_copy(__DIR__ . '/template/images', $logDir . '/images'); |
|
82 | - \recurse_copy(__DIR__ . '/template/fonts', $logDir . '/fonts'); |
|
79 | + \recurse_copy(__DIR__.'/template/js', $logDir.'/js'); |
|
80 | + \recurse_copy(__DIR__.'/template/css', $logDir.'/css'); |
|
81 | + \recurse_copy(__DIR__.'/template/images', $logDir.'/images'); |
|
82 | + \recurse_copy(__DIR__.'/template/fonts', $logDir.'/fonts'); |
|
83 | 83 | |
84 | 84 | // render dynamic pages |
85 | - $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history); |
|
86 | - $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history); |
|
87 | - $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history); |
|
88 | - $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history); |
|
89 | - $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history); |
|
90 | - $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history); |
|
91 | - $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history); |
|
92 | - $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history); |
|
93 | - $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history); |
|
85 | + $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history); |
|
86 | + $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history); |
|
87 | + $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history); |
|
88 | + $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history); |
|
89 | + $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history); |
|
90 | + $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history); |
|
91 | + $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history); |
|
92 | + $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history); |
|
93 | + $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history); |
|
94 | 94 | if ($this->config->has('git')) { |
95 | - $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history); |
|
95 | + $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history); |
|
96 | 96 | } |
97 | - $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history); |
|
97 | + $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history); |
|
98 | 98 | |
99 | 99 | // js data |
100 | 100 | \file_put_contents( |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | |
109 | 109 | // json data |
110 | 110 | \file_put_contents( |
111 | - $logDir . '/js/classes.js', |
|
112 | - 'var classes = ' . \json_encode($consolidated->getClasses(), \JSON_PRETTY_PRINT) |
|
111 | + $logDir.'/js/classes.js', |
|
112 | + 'var classes = '.\json_encode($consolidated->getClasses(), \JSON_PRETTY_PRINT) |
|
113 | 113 | ); |
114 | 114 | |
115 | 115 | $this->output->writeln(\sprintf('HTML report generated in "%s" directory', $logDir)); |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $diff = $newValue - $oldValue; |
181 | 181 | if ($diff > 0) { |
182 | - $diff = '+' . $diff; |
|
182 | + $diff = '+'.$diff; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $goodOrBad = 'neutral'; |
@@ -1,16 +1,16 @@ discard block |
||
1 | -<?php require __DIR__ . '/_header.php'; ?> |
|
1 | +<?php require __DIR__.'/_header.php'; ?> |
|
2 | 2 | |
3 | 3 | <?php |
4 | 4 | $relations = []; |
5 | 5 | $classesCp = []; |
6 | 6 | foreach ($classes as $class) { |
7 | - $class['name'] = '\\' . $class['name']; |
|
7 | + $class['name'] = '\\'.$class['name']; |
|
8 | 8 | $classesCp[$class['name']] = $class; |
9 | 9 | $classesCp[$class['name']]['externals'] = []; |
10 | 10 | |
11 | 11 | |
12 | 12 | foreach ($class['externals'] as &$ext) { |
13 | - $ext = '\\' . $ext; |
|
13 | + $ext = '\\'.$ext; |
|
14 | 14 | if (!isset($classes[$ext])) { |
15 | 15 | $classesCp[$ext] = [ |
16 | 16 | 'name' => $ext, |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } unset($ext); |
22 | 22 | } |
23 | 23 | foreach ($classesCp as $class) { |
24 | - $relations[] = (object)[ |
|
24 | + $relations[] = (object) [ |
|
25 | 25 | 'name' => $class['name'], |
26 | 26 | 'size' => 3000, |
27 | 27 | 'relations' => array_values(array_unique($class['externals'])), |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | </div> |
40 | 40 | </div> |
41 | 41 | |
42 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
42 | +<?php require __DIR__.'/_footer.php'; ?> |
|
43 | 43 | |
44 | 44 | |
45 | 45 | <script type="text/javascript"> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | |
4 | 4 | |
5 | 5 | <?php |
@@ -12,12 +12,12 @@ discard block |
||
12 | 12 | $history = array_slice($history, -24); |
13 | 13 | $json = []; |
14 | 14 | foreach ($history as $date => $values) { |
15 | - $json[] = (object)[ |
|
15 | + $json[] = (object) [ |
|
16 | 16 | 'date' => $date, |
17 | 17 | 'key' => 'Additions', |
18 | 18 | 'value' => abs($values['additions']), |
19 | 19 | ]; |
20 | - $json[] = (object)[ |
|
20 | + $json[] = (object) [ |
|
21 | 21 | 'date' => $date, |
22 | 22 | 'key' => 'Removes', |
23 | 23 | 'value' => abs($values['removes']), |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | </div> |
95 | 95 | </div> |
96 | 96 | |
97 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
97 | +<?php require __DIR__.'/_footer.php'; ?> |
|
98 | 98 | |
99 | 99 | |
100 | 100 | <script type="text/javascript"> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/_header.php'; ?> |
|
2 | +require __DIR__.'/_header.php'; ?> |
|
3 | 3 | |
4 | 4 | <div class="row"> |
5 | 5 | <div class="column"> |
@@ -83,4 +83,4 @@ discard block |
||
83 | 83 | </div> |
84 | 84 | |
85 | 85 | |
86 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
86 | +<?php require __DIR__.'/_footer.php'; ?> |