Completed
Pull Request — master (#265)
by Vincent
13:10
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
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                     // return
83 83
                     if (isset($stmt->returnType)) {
84 84
                         if ($stmt->returnType instanceof Node\Name\FullyQualified) {
85
-                            array_push($dependencies, (string)$stmt->returnType);
85
+                            array_push($dependencies, (string) $stmt->returnType);
86 86
                         }
87 87
                     }
88 88
 
@@ -90,13 +90,13 @@  discard block
 block discarded – undo
90 90
                     foreach ($stmt->params as $param) {
91 91
                         if ($param->type) {
92 92
                             if ($param->type instanceof Node\Name\FullyQualified) {
93
-                                array_push($dependencies, (string)$param->type);
93
+                                array_push($dependencies, (string) $param->type);
94 94
                             }
95 95
                         }
96 96
                     }
97 97
 
98 98
                     // instanciations, static calls
99
-                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
99
+                    \iterate_over_node($stmt, function($node) use (&$dependencies) {
100 100
                         switch (true) {
101 101
                             case $node instanceof Node\Expr\New_:
102 102
                                 // new MyClass
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                         foreach ($matches[1] as $check) {
116 116
                             foreach ($this->uses as $use) {
117 117
                                 if ($use->alias === $check) {
118
-                                    array_push($dependencies, (string)($use->name));
118
+                                    array_push($dependencies, (string) ($use->name));
119 119
                                 }
120 120
                             }
121 121
                         }
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Text/HalsteadVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
             $operands = [];
57 57
             $operators = [];
58 58
 
59
-            iterate_over_node($node, function ($node) use (&$operators, &$operands) {
59
+            iterate_over_node($node, function($node) use (&$operators, &$operands) {
60 60
 
61 61
                 if (
62 62
                     $node instanceof Node\Expr\BinaryOp
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/ClassEnumVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
             }
83 83
 
84 84
             $class->set('methods', $methods);
85
-            $class->set('nbMethodsIncludingGettersSetters', sizeof($methods) );
85
+            $class->set('nbMethodsIncludingGettersSetters', sizeof($methods));
86 86
             $class->set('nbMethods', sizeof($methods) - ($nbGetters + $nbSetters));
87 87
             $class->set('nbMethodsPrivate', $methodsPrivate);
88 88
             $class->set('nbMethodsPublic', $methodsPublic);
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Structural/SystemComplexityVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
                     $output = 0;
53 53
                     $fanout = [];
54 54
 
55
-                    iterate_over_node($node, function ($node) use (&$output, &$fanout) {
55
+                    iterate_over_node($node, function($node) use (&$output, &$fanout) {
56 56
                         switch (true) {
57 57
                             case $node instanceof Stmt\Return_:
58 58
                                 $output++;
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Structural/LcomVisitor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
             foreach ($node->stmts as $stmt) {
46 46
                 if ($stmt instanceof Stmt\ClassMethod) {
47 47
 
48
-                    if (!$graph->has($stmt->name . '()')) {
49
-                        $graph->insert(new TreeNode($stmt->name . '()'));
48
+                    if (!$graph->has($stmt->name.'()')) {
49
+                        $graph->insert(new TreeNode($stmt->name.'()'));
50 50
                     }
51
-                    $from = $graph->get($stmt->name . '()');
51
+                    $from = $graph->get($stmt->name.'()');
52 52
 
53
-                    \iterate_over_node($stmt, function ($node) use ($from, &$graph) {
53
+                    \iterate_over_node($stmt, function($node) use ($from, &$graph) {
54 54
 
55 55
                         if ($node instanceof Node\Expr\PropertyFetch && isset($node->var->name) && $node->var->name == 'this') {
56 56
                             $name = getNameOfNode($node);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
                             if (!$node->var instanceof Node\Expr\New_ && isset($node->var->name) && getNameOfNode($node->var) === 'this') {
69 69
                                 // use of method call $this->xxx();
70 70
                                 // use of attribute $this->xxx;
71
-                                $name = getNameOfNode($node->name) . '()';
71
+                                $name = getNameOfNode($node->name).'()';
72 72
                                 if (!$graph->has($name)) {
73 73
                                     $graph->insert(new TreeNode($name));
74 74
                                 }
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 childs, 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/Metric/Class_/Complexity/KanDefectVisitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
             $select = $while = $if = 0;
44 44
 
45
-            iterate_over_node($node, function ($node) use (&$while, &$select, &$if) {
45
+            iterate_over_node($node, function($node) use (&$while, &$select, &$if) {
46 46
                 switch (true) {
47 47
                     case $node instanceof Stmt\Do_:
48 48
                     case $node instanceof Stmt\Foreach_:
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
                 }
59 59
             });
60 60
 
61
-            $defect = 0.15 + 0.23 *  $while + 0.22 *  $select + 0.07 * $if;
61
+            $defect = 0.15 + 0.23 * $while + 0.22 * $select + 0.07 * $if;
62 62
             $class->set('kanDefect', round($defect, 2));
63 63
         }
64 64
     }
Please login to merge, or discard this patch.
src/Hal/Metric/System/Changes/GitChanges.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         }
52 52
 
53 53
         $r = shell_exec(sprintf('%s --version', $bin));
54
-        if(!preg_match('!git version!', $r)) {
54
+        if (!preg_match('!git version!', $r)) {
55 55
             throw new ConfigException(sprintf('Git binary (%s) incorrect', $bin));
56 56
         }
57 57
 
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
@@ -89,10 +89,10 @@
 block discarded – undo
89 89
 
90 90
             // list of externals sources of unit test
91 91
             $metric = $metricsOfUnitTest->get($classname);
92
-            $externals = (array)$metric->get('externals');
92
+            $externals = (array) $metric->get('externals');
93 93
 
94 94
             // global stats for each test
95
-            $infoAboutTests[$classname] = (object)[
95
+            $infoAboutTests[$classname] = (object) [
96 96
                 'nbExternals' => sizeof(array_unique($externals)),
97 97
                 'externals' => array_unique($externals),
98 98
                 'filename' => $fileOfUnitTest,
Please login to merge, or discard this patch.