Completed
Pull Request — master (#370)
by Löki
04:56
created
src/Hal/Metric/Class_/Coupling/ExternalsVisitor.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -136,6 +136,9 @@
 block discarded – undo
136 136
         }
137 137
     }
138 138
 
139
+    /**
140
+     * @param string|null $dependency
141
+     */
139 142
     private function pushToDependencies(array &$dependencies, $dependency)
140 143
     {
141 144
         $lowercase = strtolower($dependency);
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 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
-                        $this->pushToDependencies($dependencies, (string)$interface);
67
-                        array_push($parents, (string)$interface);
65
+                    foreach ((array) $node->extends as $interface) {
66
+                        $this->pushToDependencies($dependencies, (string) $interface);
67
+                        array_push($parents, (string) $interface);
68 68
                     }
69 69
                 } else {
70
-                    $this->pushToDependencies($dependencies, (string)$node->extends);
71
-                    array_push($parents, (string)$node->extends);
70
+                    $this->pushToDependencies($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
-                    $this->pushToDependencies($dependencies, (string)$interface);
78
+                    $this->pushToDependencies($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
-                            $this->pushToDependencies($dependencies, (string)$stmt->returnType);
87
+                            $this->pushToDependencies($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
-                                $this->pushToDependencies($dependencies, (string)$param->type);
95
+                                $this->pushToDependencies($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
@@ -118,12 +118,12 @@  discard block
 block discarded – undo
118 118
                             foreach ($this->uses as $use) {
119 119
                                 if (method_exists($use, 'getAlias')) {
120 120
                                     if (((string) $use->getAlias()) === $check) {
121
-                                        $this->pushToDependencies($dependencies, (string)($use->name));
121
+                                        $this->pushToDependencies($dependencies, (string) ($use->name));
122 122
                                     }
123 123
                                     continue;
124 124
                                 }
125 125
                                 if ($use->alias === $check) {
126
-                                    $this->pushToDependencies($dependencies, (string)($use->name));
126
+                                    $this->pushToDependencies($dependencies, (string) ($use->name));
127 127
                                 }
128 128
                             }
129 129
                         }
Please login to merge, or discard this patch.