@@ -51,8 +51,8 @@ |
||
51 | 51 | $name = getNameOfNode($node); |
52 | 52 | $classOrFunction = $this->metrics->get($name); |
53 | 53 | |
54 | - if(null === $classOrFunction) { |
|
55 | - throw new \LogicException('class or function ' . $name . ' not found in metrics'); |
|
54 | + if (null === $classOrFunction) { |
|
55 | + throw new \LogicException('class or function '.$name.' not found in metrics'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | if (null === $lloc = $classOrFunction->get('lloc')) { |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (NodeTyper::isOrganizedLogicalClassStructure($node)) { |
43 | 43 | $class = $this->metrics->get(getNameOfNode($node)); |
44 | 44 | if (null === $class) { |
45 | - throw new \RuntimeException('Class metric not found for ' . getNameOfNode($node)); |
|
45 | + throw new \RuntimeException('Class metric not found for '.getNameOfNode($node)); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $sy = $dc = $sc = []; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $fanout = []; |
55 | 55 | |
56 | 56 | $parentNode = $node; |
57 | - iterate_over_node($node, function ($node) use (&$output, &$fanout, $parentNode) { |
|
57 | + iterate_over_node($node, function($node) use (&$output, &$fanout, $parentNode) { |
|
58 | 58 | switch (true) { |
59 | 59 | case $node instanceof Stmt\Return_: |
60 | 60 | $output++; |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | if ('static' === $class || 'self' === $class) { |
65 | 65 | $class = getNameOfNode($parentNode); |
66 | 66 | } |
67 | - $fanout[] = $class . '::' . getNameOfNode($node->name) . '()'; |
|
67 | + $fanout[] = $class.'::'.getNameOfNode($node->name).'()'; |
|
68 | 68 | break; |
69 | 69 | case $node instanceof Node\Expr\MethodCall: |
70 | 70 | $class = getNameOfNode($node->var); |
71 | 71 | if ('this' === $class) { |
72 | 72 | $class = getNameOfNode($parentNode); |
73 | 73 | } |
74 | - $fanout[] = $class . '->' . getNameOfNode($node->name) . '()'; |
|
74 | + $fanout[] = $class.'->'.getNameOfNode($node->name).'()'; |
|
75 | 75 | break; |
76 | 76 | } |
77 | 77 | }); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | NodeTyper::isOrganizedLogicalClassStructure($node) |
47 | 47 | || $node instanceof Stmt\Function_ |
48 | 48 | ) { |
49 | - if (NodeTyper::isOrganizedLogicalClassStructure($node) ) { |
|
49 | + if (NodeTyper::isOrganizedLogicalClassStructure($node)) { |
|
50 | 50 | $name = getNameOfNode($node); |
51 | 51 | $classOrFunction = $this->metrics->get($name); |
52 | 52 | } else { |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $operands = []; |
59 | 59 | $operators = []; |
60 | 60 | |
61 | - iterate_over_node($node, function ($node) use (&$operators, &$operands) { |
|
61 | + iterate_over_node($node, function($node) use (&$operators, &$operands) { |
|
62 | 62 | if ($node instanceof Node\Expr\BinaryOp |
63 | 63 | || $node instanceof Node\Expr\AssignOp |
64 | 64 | || $node instanceof Stmt\If_ |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if (NodeTyper::isOrganizedStructure($node)) { |
57 | 57 | $class = $this->metrics->get(getNameOfNode($node)); |
58 | 58 | if ($class === null) { |
59 | - throw new \RuntimeException('Class metric not found for ' . getNameOfNode($node)); |
|
59 | + throw new \RuntimeException('Class metric not found for '.getNameOfNode($node)); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $ccn = 1; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // iterate over children, recursively |
78 | - $cb = function ($node) use (&$cb) { |
|
78 | + $cb = function($node) use (&$cb) { |
|
79 | 79 | $ccn = 0; |
80 | 80 | |
81 | 81 | foreach (get_object_vars($node) as $name => $member) { |
@@ -66,7 +66,7 @@ |
||
66 | 66 | $roleDetector = new RoleOfMethodDetector(); |
67 | 67 | foreach ($node->stmts as $stmt) { |
68 | 68 | if ($stmt instanceof Stmt\ClassMethod) { |
69 | - $function = new FunctionMetric((string)$stmt->name); |
|
69 | + $function = new FunctionMetric((string) $stmt->name); |
|
70 | 70 | |
71 | 71 | $role = $roleDetector->detects($stmt); |
72 | 72 | $function->set('role', $role); |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | if (NodeTyper::isOrganizedStructure($node)) { |
50 | 50 | $class = $this->metrics->get(getNameOfNode($node)); |
51 | 51 | |
52 | - if(null === $class) { |
|
53 | - throw new \RuntimeException('Class metric not found for ' . getNameOfNode($node)); |
|
52 | + if (null === $class) { |
|
53 | + throw new \RuntimeException('Class metric not found for '.getNameOfNode($node)); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | $parents = []; |
@@ -98,7 +98,7 @@ discard block |
||
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 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | public function calculate(Metrics $metrics) |
11 | 11 | { |
12 | 12 | /* @var $packages PackageMetric[] */ |
13 | - $packages = array_filter($metrics->all(), function ($metric) { |
|
13 | + $packages = array_filter($metrics->all(), function($metric) { |
|
14 | 14 | return $metric instanceof PackageMetric; |
15 | 15 | }); |
16 | 16 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | // Set depending instabilities |
30 | 30 | foreach ($packages as $eachPackage) { |
31 | - $dependentInstabilities = array_map(function ($packageName) use ($instabilitiesByPackage) { |
|
31 | + $dependentInstabilities = array_map(function($packageName) use ($instabilitiesByPackage) { |
|
32 | 32 | //return $instabilitiesByPackage[$packageName] ?? null; |
33 | 33 | return isset($instabilitiesByPackage[$packageName]) ? $instabilitiesByPackage[$packageName] : null; |
34 | 34 | }, $eachPackage->getOutgoingPackageDependencies()); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // exclude extensions |
64 | - $packages = array_filter($packages, function ($package) { |
|
64 | + $packages = array_filter($packages, function($package) { |
|
65 | 65 | return !preg_match('!(^php$|^ext\-)!', $package->name); |
66 | 66 | }); |
67 | 67 |
@@ -121,7 +121,7 @@ |
||
121 | 121 | ]); |
122 | 122 | |
123 | 123 | if (!file_exists($suite->file) || !is_readable($suite->file)) { |
124 | - throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file); |
|
124 | + throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $code = file_get_contents($suite->file); |