@@ -60,18 +60,18 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -56,7 +56,7 @@ |
||
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 |
@@ -82,7 +82,7 @@ |
||
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); |
@@ -52,7 +52,7 @@ |
||
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++; |
@@ -45,12 +45,12 @@ discard block |
||
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 |
||
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 | } |
@@ -55,7 +55,7 @@ |
||
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) { |
@@ -42,7 +42,7 @@ discard block |
||
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 |
||
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 | } |
@@ -51,7 +51,7 @@ |
||
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 |
@@ -89,10 +89,10 @@ |
||
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, |