Completed
Pull Request — master (#314)
by
unknown
02:03
created
src/Hal/Report/Csv/Reporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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';
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/relations.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/git.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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">
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/complexity.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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
 block discarded – undo
83 83
     </div>
84 84
 
85 85
 
86
-<?php require __DIR__ . '/_footer.php'; ?>
86
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/junit.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require __DIR__ . '/_header.php'; ?>
2
+require __DIR__.'/_header.php'; ?>
3 3
 
4 4
 <?php
5 5
 if (!isset($project['unitTesting'])) {
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 
10 10
 $unit = $project['unitTesting'];
11
-$getMetricForClass = function ($classname, $metric) use ($classes) {
11
+$getMetricForClass = function($classname, $metric) use ($classes) {
12 12
     foreach ($classes as $class) {
13 13
         if ($classname !== $class['name']) {
14 14
             continue;
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         </div>
137 137
     </div>
138 138
 
139
-    <?php require __DIR__ . '/_footer.php'; ?>
139
+    <?php require __DIR__.'/_footer.php'; ?>
140 140
 
141 141
     <script type="text/javascript">
142 142
         var clusterize = new Clusterize({
@@ -191,12 +191,12 @@  discard block
 block discarded – undo
191 191
             foreach ($unit['tests'] as $test) {
192 192
                 $unitTimeJson->children[] = [
193 193
                     'name' => $test->classname,
194
-                    'time' => (float)$test->time,
194
+                    'time' => (float) $test->time,
195 195
                 ];
196 196
             }
197 197
             ?>
198 198
 
199
-            var json = <?php echo json_encode($unitTimeJson);?>;
199
+            var json = <?php echo json_encode($unitTimeJson); ?>;
200 200
             root = json;
201 201
             var nodes = treemap.nodes(json)
202 202
                 .filter(function (d) {
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/all.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $fullwidth = true;
3
-require __DIR__ . '/_header.php'; ?>
3
+require __DIR__.'/_header.php'; ?>
4 4
 
5 5
 <?php
6 6
 
@@ -37,4 +37,4 @@  discard block
 block discarded – undo
37 37
             </div>
38 38
         </div>
39 39
     </div>
40
-<?php require __DIR__ . '/_footer.php'; ?>
40
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/_footer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
                             <path d="M0 0h24v24H0z" fill="none"/>
29 29
                             <path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/>
30 30
                         </svg>
31
-                        Violations (<?php echo $sum->violations->total;?>)
31
+                        Violations (<?php echo $sum->violations->total; ?>)
32 32
                     </a>
33 33
                 </li>
34 34
                 <?php if ($this->config->has('junit')) { ?>
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/panel.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $fullwidth = true;
3
-require __DIR__ . '/_header.php'; ?>
3
+require __DIR__.'/_header.php'; ?>
4 4
 
5 5
     <div class="row">
6 6
         <div class="column">
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                     <tbody>
82 82
                     <?php
83 83
                     $classesS = $classes;
84
-                    usort($classesS, function ($a, $b) {
84
+                    usort($classesS, function($a, $b) {
85 85
                         return strcmp($b['pageRank'], $a['pageRank']);
86 86
                     });
87 87
                     $classesS = array_slice($classesS, 0, 10);
@@ -131,4 +131,4 @@  discard block
 block discarded – undo
131 131
     </script>
132 132
 
133 133
 <?php
134
-require __DIR__ . '/_footer.php'; ?>
134
+require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.