Completed
Pull Request — master (#281)
by Oskar
02:32
created
src/Hal/Metric/Class_/Coupling/ExternalsVisitor.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,18 +60,18 @@  discard block
 block discarded – undo
60 60
             // extends
61 61
             if (isset($node->extends)) {
62 62
                 if (is_array($node->extends)) {
63
-                    foreach ((array)$node->extends as $interface) {
64
-                        array_push($dependencies, (string)$interface);
63
+                    foreach ((array) $node->extends as $interface) {
64
+                        array_push($dependencies, (string) $interface);
65 65
                     }
66 66
                 } else {
67
-                    array_push($dependencies, (string)$node->extends);
67
+                    array_push($dependencies, (string) $node->extends);
68 68
                 }
69 69
             }
70 70
 
71 71
             // implements
72 72
             if (isset($node->implements)) {
73 73
                 foreach ($node->implements as $interface) {
74
-                    array_push($dependencies, (string)$interface);
74
+                    array_push($dependencies, (string) $interface);
75 75
                 }
76 76
             }
77 77
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     // return
81 81
                     if (isset($stmt->returnType)) {
82 82
                         if ($stmt->returnType instanceof Node\Name\FullyQualified) {
83
-                            array_push($dependencies, (string)$stmt->returnType);
83
+                            array_push($dependencies, (string) $stmt->returnType);
84 84
                         }
85 85
                     }
86 86
 
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
                     foreach ($stmt->params as $param) {
89 89
                         if ($param->type) {
90 90
                             if ($param->type instanceof Node\Name\FullyQualified) {
91
-                                array_push($dependencies, (string)$param->type);
91
+                                array_push($dependencies, (string) $param->type);
92 92
                             }
93 93
                         }
94 94
                     }
95 95
 
96 96
                     // instantiations, static calls
97
-                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
97
+                    \iterate_over_node($stmt, function($node) use (&$dependencies) {
98 98
                         switch (true) {
99 99
                             case $node instanceof Node\Expr\New_:
100 100
                                 // new MyClass
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                         foreach ($matches[1] as $check) {
114 114
                             foreach ($this->uses as $use) {
115 115
                                 if ($use->alias === $check) {
116
-                                    array_push($dependencies, (string)($use->name));
116
+                                    array_push($dependencies, (string) ($use->name));
117 117
                                 }
118 118
                             }
119 119
                         }
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Complexity/CyclomaticComplexityVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 if ($stmt instanceof Stmt\ClassMethod) {
56 56
 
57 57
                     // iterate over children, recursively
58
-                    $cb = function ($node) use (&$cb) {
58
+                    $cb = function($node) use (&$cb) {
59 59
                         $ccn = 0;
60 60
                         if (isset($node->stmts) && $node->stmts) {
61 61
                             foreach ($node->stmts as $child) {
Please login to merge, or discard this patch.
src/Hal/Report/Html/template/loc.php 1 patch
Spacing   +4 added lines, -4 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
 
3 3
 
4 4
 <?php
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 
20 20
 // 2. percentile map
21 21
 $json = [];
22
-if(sizeof($array) > 1) {
22
+if (sizeof($array) > 1) {
23 23
     $range = range(0.5, 1, .05);
24 24
     foreach ($range as $percentile) {
25
-        $json[] = (object)[
25
+        $json[] = (object) [
26 26
             'lloc' => procentile($array, $percentile),
27 27
             'percentile' => $percentile * 100,
28 28
         ];
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 </div>
75 75
 
76 76
 
77
-<?php require __DIR__ . '/_footer.php'; ?>
77
+<?php require __DIR__.'/_footer.php'; ?>
78 78
 
79 79
 
80 80
 <script>
Please login to merge, or discard this patch.
src/Hal/Component/Output/ProgressBar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
         if (DIRECTORY_SEPARATOR === '\\') {
98 98
             return
99 99
                 0 >= version_compare('10.0.10586',
100
-                    PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD)
100
+                    PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
101 101
                 || false !== getenv('ANSICON')
102 102
                 || 'ON' === getenv('ConEmuANSI')
103 103
                 || 'xterm' === getenv('TERM');
Please login to merge, or discard this patch.
src/Hal/Component/Output/TestOutput.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function writeln($message)
25 25
     {
26
-        $this->write(PHP_EOL . $message);
26
+        $this->write(PHP_EOL.$message);
27 27
         return $this;
28 28
     }
29 29
 
Please login to merge, or discard this patch.
src/Hal/Component/Output/CliOutput.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function writeln($message)
27 27
     {
28
-        $this->write(PHP_EOL . $message);
28
+        $this->write(PHP_EOL.$message);
29 29
         return $this;
30 30
     }
31 31
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function write($message)
36 36
     {
37
-        $this->quietMode||file_put_contents('php://stdout', $message);
37
+        $this->quietMode || file_put_contents('php://stdout', $message);
38 38
         return $this;
39 39
     }
40 40
 
Please login to merge, or discard this patch.
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/Metric/System/UnitTesting/UnitTesting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         // JUNIT format
74 74
         foreach ($xpath->query('//testsuite[@file]') as $suite) {
75
-            array_push($testsuites, (object)[
75
+            array_push($testsuites, (object) [
76 76
                 'file' => $suite->getAttribute('file'),
77 77
                 'name' => $suite->getAttribute('name'),
78 78
                 'assertions' => $suite->getAttribute('assertions'),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 $assertions = $case === $suite->firstChild->nextSibling ? $suite->getAttribute('assertions') : 0;
102 102
             }
103 103
 
104
-            $testsuites[$case->getAttribute('class')] = (object)[
104
+            $testsuites[$case->getAttribute('class')] = (object) [
105 105
                 'file' => $case->getAttribute('file'),
106 106
                 'name' => $case->getAttribute('class'),
107 107
                 'assertions' => $assertions,
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest));
121 121
 
122 122
             if (!file_exists($suite->file) || !is_readable($suite->file)) {
123
-                throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file);
123
+                throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file);
124 124
             }
125 125
 
126 126
             $code = file_get_contents($suite->file);
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 
134 134
             // list of externals sources of unit test
135 135
             $metric = $metricsOfUnitTest->get($suite->name);
136
-            $externals = (array)$metric->get('externals');
136
+            $externals = (array) $metric->get('externals');
137 137
 
138 138
             // global stats for each test
139
-            $infoAboutTests[$suite->name] = (object)[
139
+            $infoAboutTests[$suite->name] = (object) [
140 140
                 'nbExternals' => sizeof(array_unique($externals)),
141 141
                 'externals' => array_unique($externals),
142 142
                 'filename' => $suite->file,
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
                 array_push($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.