@@ -81,7 +81,7 @@ |
||
81 | 81 | $metrics = new Metrics(); |
82 | 82 | |
83 | 83 | // Traverse all files. |
84 | - $whenToStop = function () { |
|
84 | + $whenToStop = function() { |
|
85 | 85 | return true; |
86 | 86 | }; |
87 | 87 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | */ |
28 | 28 | public function addEdge(Node $from, Node $to) |
29 | 29 | { |
30 | - $key = $from->getUniqueId() . '->' . $to->getUniqueId(); |
|
30 | + $key = $from->getUniqueId().'->'.$to->getUniqueId(); |
|
31 | 31 | |
32 | 32 | if (isset($this->edgesMap[$key])) { |
33 | 33 | return $this; |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $output = 0; |
60 | 60 | $fanOut = []; |
61 | 61 | |
62 | - \iterate_over_node($node, function ($node) use (&$output, &$fanOut) { |
|
62 | + \iterate_over_node($node, function($node) use (&$output, &$fanOut) { |
|
63 | 63 | switch (true) { |
64 | 64 | case $node instanceof Stmt\Return_: |
65 | 65 | $output++; |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | |
52 | - $graph->insertFromName($stmt->name . '()'); |
|
53 | - $from = $graph->get($stmt->name . '()'); |
|
52 | + $graph->insertFromName($stmt->name.'()'); |
|
53 | + $from = $graph->get($stmt->name.'()'); |
|
54 | 54 | |
55 | - \iterate_over_node($stmt, function ($node) use ($from, $graph) { |
|
55 | + \iterate_over_node($stmt, function($node) use ($from, $graph) { |
|
56 | 56 | $nodeChecker = new NodeChecker($node); |
57 | 57 | |
58 | 58 | if ($nodeChecker->isCalledByProperty()) { |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | if ($nodeChecker->isCalledByMethodCall()) { |
66 | 66 | // use of method call $this->xxx(); |
67 | - $name = \getNameOfNode($node->name) . '()'; |
|
67 | + $name = \getNameOfNode($node->name).'()'; |
|
68 | 68 | $graph->addEdge($from, $graph->insertFromName($name)->get($name)); |
69 | 69 | return; |
70 | 70 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $operands = []; |
63 | 63 | $operators = []; |
64 | 64 | |
65 | - \iterate_over_node($node, function ($node) use (&$operators, &$operands) { |
|
65 | + \iterate_over_node($node, function($node) use (&$operators, &$operands) { |
|
66 | 66 | |
67 | 67 | if ($node instanceof Node\Expr\BinaryOp |
68 | 68 | || $node instanceof Node\Expr\AssignOp |
@@ -86,7 +86,7 @@ |
||
86 | 86 | $code = \preg_replace('!/\*.*?\*/!s', '', $code); |
87 | 87 | |
88 | 88 | // Count and remove single line comments. |
89 | - $incrementCLoc = function (array $matches) use (&$cLoc) { |
|
89 | + $incrementCLoc = function(array $matches) use (&$cLoc) { |
|
90 | 90 | $cLoc += isset($matches[2]); |
91 | 91 | return $matches[1]; |
92 | 92 | }; |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if ($node instanceof \PhpParser\Node\Name\FullyQualified) { |
92 | - return (string)$node; |
|
92 | + return (string) $node; |
|
93 | 93 | } |
94 | 94 | if ($node instanceof \PhpParser\Node\Expr\New_) { |
95 | 95 | return getNameOfNode($node->class); |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | } |
129 | 129 | |
130 | 130 | if (isset($node->name) && null === $node->name) { |
131 | - return 'anonymous@' . spl_object_hash($node); |
|
131 | + return 'anonymous@'.spl_object_hash($node); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | if (isset($node->name)) { |
135 | - return (string)$node->name; |
|
135 | + return (string) $node->name; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | return null; |
@@ -150,10 +150,10 @@ discard block |
||
150 | 150 | } |
151 | 151 | while (false !== ($file = readdir($dir))) { |
152 | 152 | if (('.' != $file) && ('..' != $file)) { |
153 | - if (is_dir($src . '/' . $file)) { |
|
154 | - recurse_copy($src . '/' . $file, $dst . '/' . $file); |
|
153 | + if (is_dir($src.'/'.$file)) { |
|
154 | + recurse_copy($src.'/'.$file, $dst.'/'.$file); |
|
155 | 155 | } else { |
156 | - copy($src . '/' . $file, $dst . '/' . $file); |
|
156 | + copy($src.'/'.$file, $dst.'/'.$file); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | } |