Completed
Pull Request — master (#347)
by Oskar
04:58
created
src/Hal/Metric/Class_/Coupling/ExternalsVisitor.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
             // extends
64 64
             if (isset($node->extends)) {
65 65
                 if (is_array($node->extends)) {
66
-                    foreach ((array)$node->extends as $interface) {
67
-                        array_push($dependencies, (string)$interface);
68
-                        array_push($parents, (string)$interface);
66
+                    foreach ((array) $node->extends as $interface) {
67
+                        array_push($dependencies, (string) $interface);
68
+                        array_push($parents, (string) $interface);
69 69
                     }
70 70
                 } else {
71
-                    array_push($dependencies, (string)$node->extends);
72
-                    array_push($parents, (string)$node->extends);
71
+                    array_push($dependencies, (string) $node->extends);
72
+                    array_push($parents, (string) $node->extends);
73 73
                 }
74 74
             }
75 75
 
76 76
             // implements
77 77
             if (isset($node->implements)) {
78 78
                 foreach ($node->implements as $interface) {
79
-                    array_push($dependencies, (string)$interface);
79
+                    array_push($dependencies, (string) $interface);
80 80
                 }
81 81
             }
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                     // return
86 86
                     if (isset($stmt->returnType)) {
87 87
                         if ($stmt->returnType instanceof Node\Name\FullyQualified) {
88
-                            array_push($dependencies, (string)$stmt->returnType);
88
+                            array_push($dependencies, (string) $stmt->returnType);
89 89
                         }
90 90
                     }
91 91
 
@@ -93,13 +93,13 @@  discard block
 block discarded – undo
93 93
                     foreach ($stmt->params as $param) {
94 94
                         if ($param->type) {
95 95
                             if ($param->type instanceof Node\Name\FullyQualified) {
96
-                                array_push($dependencies, (string)$param->type);
96
+                                array_push($dependencies, (string) $param->type);
97 97
                             }
98 98
                         }
99 99
                     }
100 100
 
101 101
                     // instantiations, static calls
102
-                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
102
+                    \iterate_over_node($stmt, function($node) use (&$dependencies) {
103 103
                         switch (true) {
104 104
                             case $node instanceof Node\Expr\New_:
105 105
                                 // new MyClass
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
                             foreach ($this->uses as $use) {
120 120
                                 if (method_exists($use, 'getAlias')) {
121 121
                                     if (((string) $use->getAlias()) === $check) {
122
-                                        array_push($dependencies, (string)($use->name));
122
+                                        array_push($dependencies, (string) ($use->name));
123 123
                                     }
124 124
                                     continue;
125 125
                                 }
126 126
                                 if ($use->alias === $check) {
127
-                                    array_push($dependencies, (string)($use->name));
127
+                                    array_push($dependencies, (string) ($use->name));
128 128
                                 }
129 129
                             }
130 130
                         }
Please login to merge, or discard this patch.