Completed
Push — master ( 9d78dc...42c3a8 )
by personal
34s queued 26s
created
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     {
32 32
         $this->config = $config;
33 33
         $this->output = $output;
34
-        $this->templateDir = __DIR__ . '/../../../../templates';
34
+        $this->templateDir = __DIR__.'/../../../../templates';
35 35
     }
36 36
 
37 37
 
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
         $consolidated = new Consolidated($metrics);
47 47
 
48 48
         // history of builds
49
-        $today = (object)[
49
+        $today = (object) [
50 50
             'avg' => $consolidated->getAvg(),
51 51
             'sum' => $consolidated->getSum()
52 52
         ];
53
-        $files = glob($logDir . '/js/history-*.json');
53
+        $files = glob($logDir.'/js/history-*.json');
54 54
         $next = count($files) + 1;
55 55
         $history = [];
56 56
         natsort($files);
@@ -59,39 +59,39 @@  discard block
 block discarded – undo
59 59
         }
60 60
 
61 61
         // copy sources
62
-        if (!file_exists($logDir . '/js')) {
63
-            mkdir($logDir . '/js', 0755, true);
62
+        if (!file_exists($logDir.'/js')) {
63
+            mkdir($logDir.'/js', 0755, true);
64 64
         }
65
-        if (!file_exists($logDir . '/css')) {
66
-            mkdir($logDir . '/css', 0755, true);
65
+        if (!file_exists($logDir.'/css')) {
66
+            mkdir($logDir.'/css', 0755, true);
67 67
         }
68
-        if (!file_exists($logDir . '/images')) {
69
-            mkdir($logDir . '/images', 0755, true);
68
+        if (!file_exists($logDir.'/images')) {
69
+            mkdir($logDir.'/images', 0755, true);
70 70
         }
71
-        if (!file_exists($logDir . '/fonts')) {
72
-            mkdir($logDir . '/fonts', 0755, true);
71
+        if (!file_exists($logDir.'/fonts')) {
72
+            mkdir($logDir.'/fonts', 0755, true);
73 73
         }
74
-        recurse_copy($this->templateDir . '/html_report/js', $logDir . '/js');
75
-        recurse_copy($this->templateDir . '/html_report/css', $logDir . '/css');
76
-        recurse_copy($this->templateDir . '/html_report/images', $logDir . '/images');
77
-        recurse_copy($this->templateDir . '/html_report/fonts', $logDir . '/fonts');
74
+        recurse_copy($this->templateDir.'/html_report/js', $logDir.'/js');
75
+        recurse_copy($this->templateDir.'/html_report/css', $logDir.'/css');
76
+        recurse_copy($this->templateDir.'/html_report/images', $logDir.'/images');
77
+        recurse_copy($this->templateDir.'/html_report/fonts', $logDir.'/fonts');
78 78
 
79 79
         // render dynamic pages
80
-        $this->renderPage($this->templateDir . '/html_report/index.php', $logDir . '/index.html', $consolidated, $history);
81
-        $this->renderPage($this->templateDir . '/html_report/loc.php', $logDir . '/loc.html', $consolidated, $history);
82
-        $this->renderPage($this->templateDir . '/html_report/relations.php', $logDir . '/relations.html', $consolidated, $history);
83
-        $this->renderPage($this->templateDir . '/html_report/coupling.php', $logDir . '/coupling.html', $consolidated, $history);
84
-        $this->renderPage($this->templateDir . '/html_report/all.php', $logDir . '/all.html', $consolidated, $history);
85
-        $this->renderPage($this->templateDir . '/html_report/oop.php', $logDir . '/oop.html', $consolidated, $history);
86
-        $this->renderPage($this->templateDir . '/html_report/complexity.php', $logDir . '/complexity.html', $consolidated, $history);
87
-        $this->renderPage($this->templateDir . '/html_report/panel.php', $logDir . '/panel.html', $consolidated, $history);
88
-        $this->renderPage($this->templateDir . '/html_report/violations.php', $logDir . '/violations.html', $consolidated, $history);
89
-        $this->renderPage($this->templateDir . '/html_report/packages.php', $logDir . '/packages.html', $consolidated, $history);
90
-        $this->renderPage($this->templateDir . '/html_report/package_relations.php', $logDir . '/package_relations.html', $consolidated, $history);
80
+        $this->renderPage($this->templateDir.'/html_report/index.php', $logDir.'/index.html', $consolidated, $history);
81
+        $this->renderPage($this->templateDir.'/html_report/loc.php', $logDir.'/loc.html', $consolidated, $history);
82
+        $this->renderPage($this->templateDir.'/html_report/relations.php', $logDir.'/relations.html', $consolidated, $history);
83
+        $this->renderPage($this->templateDir.'/html_report/coupling.php', $logDir.'/coupling.html', $consolidated, $history);
84
+        $this->renderPage($this->templateDir.'/html_report/all.php', $logDir.'/all.html', $consolidated, $history);
85
+        $this->renderPage($this->templateDir.'/html_report/oop.php', $logDir.'/oop.html', $consolidated, $history);
86
+        $this->renderPage($this->templateDir.'/html_report/complexity.php', $logDir.'/complexity.html', $consolidated, $history);
87
+        $this->renderPage($this->templateDir.'/html_report/panel.php', $logDir.'/panel.html', $consolidated, $history);
88
+        $this->renderPage($this->templateDir.'/html_report/violations.php', $logDir.'/violations.html', $consolidated, $history);
89
+        $this->renderPage($this->templateDir.'/html_report/packages.php', $logDir.'/packages.html', $consolidated, $history);
90
+        $this->renderPage($this->templateDir.'/html_report/package_relations.php', $logDir.'/package_relations.html', $consolidated, $history);
91 91
         if ($this->config->has('git')) {
92
-            $this->renderPage($this->templateDir . '/html_report/git.php', $logDir . '/git.html', $consolidated, $history);
92
+            $this->renderPage($this->templateDir.'/html_report/git.php', $logDir.'/git.html', $consolidated, $history);
93 93
         }
94
-        $this->renderPage($this->templateDir . '/html_report/junit.php', $logDir . '/junit.html', $consolidated, $history);
94
+        $this->renderPage($this->templateDir.'/html_report/junit.php', $logDir.'/junit.html', $consolidated, $history);
95 95
 
96 96
         // js data
97 97
         file_put_contents(
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
 
106 106
         // json data
107 107
         file_put_contents(
108
-            $logDir . '/js/classes.js',
109
-            'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
108
+            $logDir.'/js/classes.js',
109
+            'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
110 110
         );
111 111
 
112 112
         $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir));
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 
174 174
         $diff = $newValue - $oldValue;
175 175
         if ($diff > 0) {
176
-            $diff = '+' . $diff;
176
+            $diff = '+'.$diff;
177 177
         }
178 178
 
179 179
         $goodOrBad = 'neutral';
Please login to merge, or discard this patch.