Completed
Pull Request — master (#271)
by Marco
02:33
created
src/Hal/Application/Application.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $output = new CliOutput();
24 24
 
25 25
         // issues and debug
26
-        $issuer = (new Issuer($output));//->enable();
26
+        $issuer = (new Issuer($output)); //->enable();
27 27
 
28 28
         // config
29 29
         $config = (new Parser())->parse($argv);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         // analyze
58 58
         try {
59 59
             $metrics = (new Analyze($config, $output, $issuer))->run($files);
60
-        }catch(ConfigException $e) {
60
+        } catch (ConfigException $e) {
61 61
             $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
62 62
             exit(1);
63 63
         }
Please login to merge, or discard this patch.
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
         $consolidated = new Consolidated($metrics);
45 45
 
46 46
         // history of builds
47
-        $today = (object)[
47
+        $today = (object) [
48 48
             'avg' => $consolidated->getAvg(),
49 49
             'sum' => $consolidated->getSum()
50 50
         ];
51
-        $files = glob($logDir . '/js/history-*.json');
51
+        $files = glob($logDir.'/js/history-*.json');
52 52
         $next = sizeof($files) + 1;
53 53
         $history = [];
54 54
         natsort($files);
@@ -57,34 +57,34 @@  discard block
 block discarded – undo
57 57
         }
58 58
 
59 59
         // copy sources
60
-        if(!file_exists($logDir . '/js')) {
60
+        if (!file_exists($logDir.'/js')) {
61 61
             mkdir($logDir.'/js', 0755, true);
62 62
         }
63
-        if(!file_exists($logDir . '/css')) {
63
+        if (!file_exists($logDir.'/css')) {
64 64
             mkdir($logDir.'/css', 0755, true);
65 65
         }
66
-        if(!file_exists($logDir . '/images')) {
66
+        if (!file_exists($logDir.'/images')) {
67 67
             mkdir($logDir.'/images', 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');
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 72
 
73 73
         // render dynamic pages
74
-        $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history);
75
-        $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history);
76
-        $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history);
77
-        $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history);
78
-        $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history);
79
-        $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history);
80
-        $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history);
81
-        $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history);
82
-        $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history);
74
+        $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history);
75
+        $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history);
76
+        $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history);
77
+        $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history);
78
+        $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history);
79
+        $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history);
80
+        $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history);
81
+        $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history);
82
+        $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history);
83 83
         if ($this->config->has('git')) {
84
-            $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history);
84
+            $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history);
85 85
         }
86 86
         if ($this->config->has('junit')) {
87
-            $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history);
87
+            $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history);
88 88
         }
89 89
 
90 90
         // js data
@@ -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));
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
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';
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,9 +1,9 @@  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
 $unit = $project['unitTesting'];
6
-$getMetricForClass = function ($classname, $metric) use ($classes) {
6
+$getMetricForClass = function($classname, $metric) use ($classes) {
7 7
     foreach ($classes as $class) {
8 8
         if ($classname !== $class['name']) {
9 9
             continue;
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         </div>
134 134
     </div>
135 135
 
136
-    <?php require __DIR__ . '/_footer.php'; ?>
136
+    <?php require __DIR__.'/_footer.php'; ?>
137 137
 
138 138
     <script type="text/javascript">
139 139
         var clusterize = new Clusterize({
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
             foreach ($unit['tests'] as $test) {
189 189
                 array_push($unitTimeJson->children, [
190 190
                     'name' => $test->classname,
191
-                    'time' => (float)$test->time,
191
+                    'time' => (float) $test->time,
192 192
                 ]);
193 193
             }
194 194
             ?>
195 195
 
196
-            var json = <?php echo json_encode($unitTimeJson);?>;
196
+            var json = <?php echo json_encode($unitTimeJson); ?>;
197 197
             root = json;
198 198
             var nodes = treemap.nodes(json)
199 199
                 .filter(function (d) {
Please login to merge, or discard this patch.
src/Hal/Metric/System/UnitTesting/UnitTesting.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,10 +108,10 @@
 block discarded – undo
108 108
 
109 109
             // list of externals sources of unit test
110 110
             $metric = $metricsOfUnitTest->get($suite->name);
111
-            $externals = (array)$metric->get('externals');
111
+            $externals = (array) $metric->get('externals');
112 112
 
113 113
             // global stats for each test
114
-            $infoAboutTests[$suite->name] = (object)[
114
+            $infoAboutTests[$suite->name] = (object) [
115 115
                 'nbExternals' => sizeof(array_unique($externals)),
116 116
                 'externals' => array_unique($externals),
117 117
                 'filename' => $fileOfUnitTest,
Please login to merge, or discard this patch.