Completed
Pull Request — master (#406)
by
unknown
01:32
created
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -40,11 +40,11 @@  discard block
 block discarded – undo
40 40
         $consolidated = new Consolidated($metrics);
41 41
 
42 42
         // history of builds
43
-        $today = (object)[
43
+        $today = (object) [
44 44
             'avg' => $consolidated->getAvg(),
45 45
             'sum' => $consolidated->getSum()
46 46
         ];
47
-        $files = glob($logDir . '/js/history-*.json');
47
+        $files = glob($logDir.'/js/history-*.json');
48 48
         $next = count($files) + 1;
49 49
         $history = [];
50 50
         natsort($files);
@@ -53,39 +53,39 @@  discard block
 block discarded – undo
53 53
         }
54 54
 
55 55
         // copy sources
56
-        if (!file_exists($logDir . '/js')) {
57
-            mkdir($logDir . '/js', 0755, true);
56
+        if (!file_exists($logDir.'/js')) {
57
+            mkdir($logDir.'/js', 0755, true);
58 58
         }
59
-        if (!file_exists($logDir . '/css')) {
60
-            mkdir($logDir . '/css', 0755, true);
59
+        if (!file_exists($logDir.'/css')) {
60
+            mkdir($logDir.'/css', 0755, true);
61 61
         }
62
-        if (!file_exists($logDir . '/images')) {
63
-            mkdir($logDir . '/images', 0755, true);
62
+        if (!file_exists($logDir.'/images')) {
63
+            mkdir($logDir.'/images', 0755, true);
64 64
         }
65
-        if (!file_exists($logDir . '/fonts')) {
66
-            mkdir($logDir . '/fonts', 0755, true);
65
+        if (!file_exists($logDir.'/fonts')) {
66
+            mkdir($logDir.'/fonts', 0755, true);
67 67
         }
68
-        recurse_copy(PROJECT_DIR . '/templates/html_report/js', $logDir . '/js');
69
-        recurse_copy(PROJECT_DIR . '/templates/html_report/css', $logDir . '/css');
70
-        recurse_copy(PROJECT_DIR . '/templates/html_report/images', $logDir . '/images');
71
-        recurse_copy(PROJECT_DIR . '/templates/html_report/fonts', $logDir . '/fonts');
68
+        recurse_copy(PROJECT_DIR.'/templates/html_report/js', $logDir.'/js');
69
+        recurse_copy(PROJECT_DIR.'/templates/html_report/css', $logDir.'/css');
70
+        recurse_copy(PROJECT_DIR.'/templates/html_report/images', $logDir.'/images');
71
+        recurse_copy(PROJECT_DIR.'/templates/html_report/fonts', $logDir.'/fonts');
72 72
 
73 73
         // render dynamic pages
74
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/index.php', $logDir . '/index.html', $consolidated, $history);
75
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/loc.php', $logDir . '/loc.html', $consolidated, $history);
76
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/relations.php', $logDir . '/relations.html', $consolidated, $history);
77
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/coupling.php', $logDir . '/coupling.html', $consolidated, $history);
78
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/all.php', $logDir . '/all.html', $consolidated, $history);
79
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/oop.php', $logDir . '/oop.html', $consolidated, $history);
80
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/complexity.php', $logDir . '/complexity.html', $consolidated, $history);
81
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/panel.php', $logDir . '/panel.html', $consolidated, $history);
82
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/violations.php', $logDir . '/violations.html', $consolidated, $history);
83
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/packages.php', $logDir . '/packages.html', $consolidated, $history);
84
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history);
74
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/index.php', $logDir.'/index.html', $consolidated, $history);
75
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/loc.php', $logDir.'/loc.html', $consolidated, $history);
76
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/relations.php', $logDir.'/relations.html', $consolidated, $history);
77
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/coupling.php', $logDir.'/coupling.html', $consolidated, $history);
78
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/all.php', $logDir.'/all.html', $consolidated, $history);
79
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/oop.php', $logDir.'/oop.html', $consolidated, $history);
80
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/complexity.php', $logDir.'/complexity.html', $consolidated, $history);
81
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/panel.php', $logDir.'/panel.html', $consolidated, $history);
82
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/violations.php', $logDir.'/violations.html', $consolidated, $history);
83
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/packages.php', $logDir.'/packages.html', $consolidated, $history);
84
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history);
85 85
         if ($this->config->has('git')) {
86
-            $this->renderPage(PROJECT_DIR . '/templates/html_report/git.php', $logDir . '/git.html', $consolidated, $history);
86
+            $this->renderPage(PROJECT_DIR.'/templates/html_report/git.php', $logDir.'/git.html', $consolidated, $history);
87 87
         }
88
-        $this->renderPage(PROJECT_DIR . '/templates/html_report/junit.php', $logDir . '/junit.html', $consolidated, $history);
88
+        $this->renderPage(PROJECT_DIR.'/templates/html_report/junit.php', $logDir.'/junit.html', $consolidated, $history);
89 89
 
90 90
         // js data
91 91
         file_put_contents(
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
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));
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 
168 168
         $diff = $newValue - $oldValue;
169 169
         if ($diff > 0) {
170
-            $diff = '+' . $diff;
170
+            $diff = '+'.$diff;
171 171
         }
172 172
 
173 173
         $goodOrBad = 'neutral';
Please login to merge, or discard this patch.