Completed
Push — master ( d9714d...e1173d )
by Oskar
05:05 queued 02:52
created
src/Hal/Report/Html/template/_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,10 +28,10 @@  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
-                <?php if($config->has('junit')) { ?>
34
+                <?php if ($config->has('junit')) { ?>
35 35
                     <li>
36 36
                         <a href="junit.html">
37 37
                             <svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
                         Coupling
108 108
                     </a>
109 109
                 </li>
110
-                <?php if($config->has('git')) { ?>
110
+                <?php if ($config->has('git')) { ?>
111 111
                 <li>
112 112
                     <a href="git.html">
113 113
                         <img src="images/logo-git.png" alt="">
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     }
91 91
 
92 92
     if ($node instanceof \PhpParser\Node\Name\FullyQualified) {
93
-        return (string)$node;
93
+        return (string) $node;
94 94
     }
95 95
     if ($node instanceof \PhpParser\Node\Expr\New_) {
96 96
         return getNameOfNode($node->class);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 
103 103
     if ($node instanceof \PhpParser\Node\Name) {
104
-        return (string)implode($node->parts);
104
+        return (string) implode($node->parts);
105 105
     }
106 106
 
107 107
     if (isset($node->name) && $node->name instanceof \PhpParser\Node\Expr\Variable) {
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
     }
130 130
 
131 131
     if (isset($node->name) && null === $node->name) {
132
-        return 'anonymous@' . spl_object_hash($node);
132
+        return 'anonymous@'.spl_object_hash($node);
133 133
     }
134 134
 
135 135
     if (isset($node->name)) {
136
-        return (string)$node->name;
136
+        return (string) $node->name;
137 137
     }
138 138
 
139 139
     return null;
@@ -151,10 +151,10 @@  discard block
 block discarded – undo
151 151
     }
152 152
     while (false !== ($file = readdir($dir))) {
153 153
         if (($file != '.') && ($file != '..')) {
154
-            if (is_dir($src . '/' . $file)) {
155
-                recurse_copy($src . '/' . $file, $dst . '/' . $file);
154
+            if (is_dir($src.'/'.$file)) {
155
+                recurse_copy($src.'/'.$file, $dst.'/'.$file);
156 156
             } else {
157
-                copy($src . '/' . $file, $dst . '/' . $file);
157
+                copy($src.'/'.$file, $dst.'/'.$file);
158 158
             }
159 159
         }
160 160
     }
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Text/LengthVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
             $code = preg_replace('!/\*.*?\*/!s', '', $code);
63 63
 
64 64
             // count and remove single line comments
65
-            $code = preg_replace_callback('!(\'[^\']*\'|"[^"]*")|((?:#|\/\/).*$)!m', function (array $matches) use (&$cloc) {
65
+            $code = preg_replace_callback('!(\'[^\']*\'|"[^"]*")|((?:#|\/\/).*$)!m', function(array $matches) use (&$cloc) {
66 66
                 if (isset($matches[2])) {
67 67
                     $cloc += 1;
68 68
                 }
Please login to merge, or discard this patch.
src/Hal/Metric/Helper/MetricClassNameGenerator.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
     public static function getName(Node $node)
18 18
     {
19 19
         return ($node instanceof Node\Stmt\Class_ && $node->isAnonymous()) ?
20
-            'anonymous@' . spl_object_hash($node) :
21
-            $node->namespacedName->toString();
20
+            'anonymous@'.spl_object_hash($node) : $node->namespacedName->toString();
22 21
     }
23 22
 }
Please login to merge, or discard this patch.
src/Hal/Report/Csv/Reporter.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
     /**
23 23
      * Reporter constructor.
24 24
      * @param Config $config
25
-     * @param OutputInterface $output
25
+     * @param Output $output
26 26
      */
27 27
     public function __construct(Config $config, Output $output)
28 28
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             return;
45 45
         }
46 46
         if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) {
47
-            throw new \RuntimeException('You don\'t have permissions to write CSV report in ' . $logFile);
47
+            throw new \RuntimeException('You don\'t have permissions to write CSV report in '.$logFile);
48 48
         }
49 49
 
50 50
         $availables = (new Registry())->allForStructures();
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Coupling/ExternalsVisitor.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -62,20 +62,20 @@  discard block
 block discarded – undo
62 62
             // extends
63 63
             if (isset($node->extends)) {
64 64
                 if (is_array($node->extends)) {
65
-                    foreach ((array)$node->extends as $interface) {
66
-                        array_push($dependencies, (string)$interface);
67
-                        array_push($parents, (string)$interface);
65
+                    foreach ((array) $node->extends as $interface) {
66
+                        array_push($dependencies, (string) $interface);
67
+                        array_push($parents, (string) $interface);
68 68
                     }
69 69
                 } else {
70
-                    array_push($dependencies, (string)$node->extends);
71
-                    array_push($parents, (string)$node->extends);
70
+                    array_push($dependencies, (string) $node->extends);
71
+                    array_push($parents, (string) $node->extends);
72 72
                 }
73 73
             }
74 74
 
75 75
             // implements
76 76
             if (isset($node->implements)) {
77 77
                 foreach ($node->implements as $interface) {
78
-                    array_push($dependencies, (string)$interface);
78
+                    array_push($dependencies, (string) $interface);
79 79
                 }
80 80
             }
81 81
 
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
                     // return
85 85
                     if (isset($stmt->returnType)) {
86 86
                         if ($stmt->returnType instanceof Node\Name\FullyQualified) {
87
-                            array_push($dependencies, (string)$stmt->returnType);
87
+                            array_push($dependencies, (string) $stmt->returnType);
88 88
                         }
89 89
                     }
90 90
 
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
                     foreach ($stmt->params as $param) {
93 93
                         if ($param->type) {
94 94
                             if ($param->type instanceof Node\Name\FullyQualified) {
95
-                                array_push($dependencies, (string)$param->type);
95
+                                array_push($dependencies, (string) $param->type);
96 96
                             }
97 97
                         }
98 98
                     }
99 99
 
100 100
                     // instantiations, static calls
101
-                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
101
+                    \iterate_over_node($stmt, function($node) use (&$dependencies) {
102 102
                         switch (true) {
103 103
                             case $node instanceof Node\Expr\New_:
104 104
                                 // new MyClass
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                         foreach ($matches[1] as $check) {
118 118
                             foreach ($this->uses as $use) {
119 119
                                 if ($use->alias === $check) {
120
-                                    array_push($dependencies, (string)($use->name));
120
+                                    array_push($dependencies, (string) ($use->name));
121 121
                                 }
122 122
                             }
123 123
                         }
Please login to merge, or discard this patch.
src/Hal/Report/Json/Reporter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             return;
43 43
         }
44 44
         if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) {
45
-            throw new \RuntimeException('You don\'t have permissions to write JSON report in ' . $logFile);
45
+            throw new \RuntimeException('You don\'t have permissions to write JSON report in '.$logFile);
46 46
         }
47 47
 
48 48
         file_put_contents($logFile, json_encode($metrics, JSON_PRETTY_PRINT));
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
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
             $package = $packagist->get($requirement);
47 47
 
48
-            $packages[$requirement] = (object)array(
48
+            $packages[$requirement] = (object) array(
49 49
                 'name' => $requirement,
50 50
                 'required' => $version,
51 51
                 'installed' => isset($rawInstalled[$requirement]) ? $rawInstalled[$requirement] : null,
@@ -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.
src/Hal/Report/Html/template/index.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php require __DIR__ . '/_header.php'; ?>
1
+<?php require __DIR__.'/_header.php'; ?>
2 2
     <div class="row">
3 3
         <div class="column">
4 4
             <div class="bloc bloc-number">
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
                             <tbody id="contentClassRank" class="clusterize-content">
96 96
                             <?php
97 97
                             $classesS = $classes;
98
-                            usort($classesS, function ($a, $b) {
98
+                            usort($classesS, function($a, $b) {
99 99
                                 return strcmp($b['pageRank'], $a['pageRank']);
100 100
                             });
101 101
                             //$classesS = array_slice($classesS, 0, 10);
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
                             <tbody id="contentPackages" class="clusterize-content">
138 138
                             <?php
139 139
                             $packages = isset($project['composer'], $project['composer']['packages']) ? $project['composer']['packages'] : [];
140
-                            usort($packages, function ($a, $b) {
140
+                            usort($packages, function($a, $b) {
141 141
                                 return strcmp($a->name, $b->name);
142 142
                             });
143 143
                             foreach ($packages as $package) { ?>
@@ -146,18 +146,18 @@  discard block
 block discarded – undo
146 146
                                     <td><?php echo $package->required; ?></td>
147 147
                                     <?php if (0 !== count($packagesInstalled)) {?><td><?php echo $package->installed; ?></td><?php } ?>
148 148
                                     <td><?php echo $package->latest; ?></td>
149
-                                    <td><?php foreach($package->license as $license) { ?>
150
-                                            <a target="_blank" href="https://spdx.org/licenses/<?php echo $license;?>.html"><?php echo $license;?></a>
149
+                                    <td><?php foreach ($package->license as $license) { ?>
150
+                                            <a target="_blank" href="https://spdx.org/licenses/<?php echo $license; ?>.html"><?php echo $license; ?></a>
151 151
                                         <?php } ?>
152 152
                                     </td>
153 153
                                 </tr>
154 154
                             <?php } ?>
155 155
                             </tbody>
156 156
                         </table>
157
-                        <?php if(0 === count($packages)) { ?>
157
+                        <?php if (0 === count($packages)) { ?>
158 158
                             <div>No composer.json file found</div>
159 159
                         <?php } ?>
160
-                        <?php if(0 === count($packagesInstalled)) { ?>
160
+                        <?php if (0 === count($packagesInstalled)) { ?>
161 161
                             <div>No composer.lock file found</div>
162 162
                         <?php } ?>
163 163
                     </div>
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         <div class="column">
169 169
             <div class="bloc bloc-number">
170 170
                 <div class="label">Licences of Composer dependencies</div>
171
-                <?php if(0 === sizeof($packages)) { ?>
171
+                <?php if (0 === sizeof($packages)) { ?>
172 172
                     <div>No composer.json file found</div>
173 173
                 <?php } ?>
174 174
                 <div id="svg-licenses"></div>
@@ -207,9 +207,9 @@  discard block
 block discarded – undo
207 207
                     }
208 208
                 }
209 209
                 ?>
210
-                chartLicenses(<?php echo json_encode(array_values($json));?>);
210
+                chartLicenses(<?php echo json_encode(array_values($json)); ?>);
211 211
             }
212 212
         };
213 213
     </script>
214 214
 
215
-<?php require __DIR__ . '/_footer.php'; ?>
215
+<?php require __DIR__.'/_footer.php'; ?>
Please login to merge, or discard this patch.