Completed
Pull Request — master (#424)
by personal
01:33
created
templates/html_report/_footer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 </div>
2 2
 
3 3
 <!-- Sidebar -->
4
-<?php if(!isset($fullwidth) || $fullwidth === false) {?>
4
+<?php if (!isset($fullwidth) || $fullwidth === false) {?>
5 5
 <div id="sidebar">
6 6
     <div class="content">
7 7
         <div class="logo">
@@ -28,7 +28,7 @@  discard block
 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
                 <li>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                         Composer
39 39
                     </a>
40 40
                 </li>
41
-                <?php if($config->has('junit')) { ?>
41
+                <?php if ($config->has('junit')) { ?>
42 42
                     <li>
43 43
                         <a href="junit.html">
44 44
                             <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                         Package relations
133 133
                     </a>
134 134
                 </li>
135
-                <?php if($config->has('git')) { ?>
135
+                <?php if ($config->has('git')) { ?>
136 136
                 <li>
137 137
                     <a href="git.html">
138 138
                         <img src="images/logo-git.png" alt="">
Please login to merge, or discard this patch.
templates/html_report/composer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  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
 $packages = isset($project['composer']['packages']) ? $project['composer']['packages'] : [];
6
-usort($packages, function ($a, $b) {
6
+usort($packages, function($a, $b) {
7 7
     return strcmp($a->name, $b->name);
8 8
 });
9 9
 if (empty($packages)) {
10 10
     echo '<div class="row"><div class="column"><div class="bloc">No composer.json file found in this project</div></div></div>';
11
-    require __DIR__ . '/_footer.php';
11
+    require __DIR__.'/_footer.php';
12 12
     return;
13 13
 }
14 14
 ?>
@@ -97,4 +97,4 @@  discard block
 block discarded – undo
97 97
     </div>
98 98
 </div>
99 99
 
100
-<?php require __DIR__ . '/_footer.php'; ?>
100
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
templates/html_report/index.php 1 patch
Spacing   +10 added lines, -10 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
     <div class="row">
4 4
         <div class="column">
5 5
             <div class="bloc bloc-number">
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 <div class="label">
52 52
                     <a href="junit.html">Assertions in tests</a>
53 53
                 </div>
54
-                <?php if(isset($project['unitTesting'])) { ?>
54
+                <?php if (isset($project['unitTesting'])) { ?>
55 55
                     <div class="number">
56 56
                         <?php echo $project['unitTesting']['assertions']; ?>
57 57
                     </div>
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
                             <tbody id="contentClassRank" class="clusterize-content">
148 148
                             <?php
149 149
                             $classesS = $classes;
150
-                            usort($classesS, static function ($a, $b) {
150
+                            usort($classesS, static function($a, $b) {
151 151
                                 return strcmp($b['pageRank'], $a['pageRank']);
152 152
                             });
153 153
                             //$classesS = array_slice($classesS, 0, 10);
154 154
                             foreach ($classesS as $class) { ?>
155 155
                                 <tr>
156 156
                                     <td>
157
-                                        <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']);?>);">
157
+                                        <span class="badge" <?php echo gradientStyleFor($classes, 'pageRank', $class['pageRank']); ?>);">
158 158
                                         <?php echo $class['pageRank']; ?>
159 159
                                     </td>
160 160
                                     </td>
@@ -166,8 +166,8 @@  discard block
 block discarded – undo
166 166
                                             $badgeTitleMI = 'Maintainability Index';
167 167
                                             $mi = isset($class['mi']) ? $class['mi'] : '';
168 168
                                         ?>
169
-                                        <span class="badge" title="<?php echo $badgeTitleMI;?>"><?php echo $mi;?></span>
170
-                                        <span class="badge" title="<?php echo $badgeTitleMIWOC;?>"><?php echo $mIwoC;?></span>
169
+                                        <span class="badge" title="<?php echo $badgeTitleMI; ?>"><?php echo $mi; ?></span>
170
+                                        <span class="badge" title="<?php echo $badgeTitleMIWOC; ?>"><?php echo $mIwoC; ?></span>
171 171
                                     </td>
172 172
                                 </tr>
173 173
                             <?php } ?>
@@ -188,11 +188,11 @@  discard block
 block discarded – undo
188 188
                 <?php
189 189
                 $packages = isset($project['composer']['packages']) ? $project['composer']['packages'] : [];
190 190
                 $packagesInstalled = isset($project['composer']['packages-installed']) ? $project['composer']['packages-installed'] : [];
191
-                if(0 === count($packages)) { ?>
191
+                if (0 === count($packages)) { ?>
192 192
                     <div class="help number-alternate"><div class="help-inner">No composer.json file found</div></div>
193 193
                 <?php } else {?>
194 194
                     <div class="number">
195
-                        <?php echo sizeof($packages);?> dependencies
195
+                        <?php echo sizeof($packages); ?> dependencies
196 196
                     </div>
197 197
                 <?php } ?>
198 198
 
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
                     }
234 234
                 }
235 235
                 ?>
236
-                chartLicenses(<?php echo json_encode(array_values($json));?>);
236
+                chartLicenses(<?php echo json_encode(array_values($json)); ?>);
237 237
             }
238 238
         };
239 239
     </script>
240 240
 
241
-<?php require __DIR__ . '/_footer.php'; ?>
241
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.
src/Hal/Report/Html/Reporter.php 1 patch
Spacing   +32 added lines, -32 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,40 +59,40 @@  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);
91
-        $this->renderPage($this->templateDir . '/html_report/composer.php', $logDir . '/composer.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
+        $this->renderPage($this->templateDir.'/html_report/composer.php', $logDir.'/composer.html', $consolidated, $history);
92 92
         if ($this->config->has('git')) {
93
-            $this->renderPage($this->templateDir . '/html_report/git.php', $logDir . '/git.html', $consolidated, $history);
93
+            $this->renderPage($this->templateDir.'/html_report/git.php', $logDir.'/git.html', $consolidated, $history);
94 94
         }
95
-        $this->renderPage($this->templateDir . '/html_report/junit.php', $logDir . '/junit.html', $consolidated, $history);
95
+        $this->renderPage($this->templateDir.'/html_report/junit.php', $logDir.'/junit.html', $consolidated, $history);
96 96
 
97 97
         // js data
98 98
         file_put_contents(
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
 
107 107
         // json data
108 108
         file_put_contents(
109
-            $logDir . '/js/classes.js',
110
-            'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
109
+            $logDir.'/js/classes.js',
110
+            'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
111 111
         );
112 112
 
113 113
         $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir));
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
         $diff = $newValue - $oldValue;
176 176
         if ($diff > 0) {
177
-            $diff = '+' . $diff;
177
+            $diff = '+'.$diff;
178 178
         }
179 179
 
180 180
         $goodOrBad = 'neutral';
Please login to merge, or discard this patch.
src/Hal/Metric/System/Packages/Composer/Composer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         }
53 53
 
54 54
         // exclude extensions
55
-        $packages = array_filter($packages, function ($package) {
55
+        $packages = array_filter($packages, function($package) {
56 56
             return !preg_match('!(^php$|^ext\-)!', $package->name);
57 57
         });
58 58
 
@@ -76,13 +76,13 @@  discard block
 block discarded – undo
76 76
             if (!\preg_match('/composer(-dist)?\.json/', $filename)) {
77 77
                 continue;
78 78
             }
79
-            $composerJson = (object)\json_decode(\file_get_contents($filename));
79
+            $composerJson = (object) \json_decode(\file_get_contents($filename));
80 80
 
81 81
             if (!isset($composerJson->require)) {
82 82
                 continue;
83 83
             }
84 84
 
85
-            $rawRequirements[] = (array)$composerJson->require;
85
+            $rawRequirements[] = (array) $composerJson->require;
86 86
         }
87 87
 
88 88
         return \call_user_func_array('array_merge', $rawRequirements);
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             if (false === \strpos($filename, 'composer.lock')) {
107 107
                 continue;
108 108
             }
109
-            $composerLockJson = (object)\json_decode(\file_get_contents($filename));
109
+            $composerLockJson = (object) \json_decode(\file_get_contents($filename));
110 110
 
111 111
             if (!isset($composerLockJson->packages)) {
112 112
                 continue;
Please login to merge, or discard this patch.