@@ -44,7 +44,7 @@ |
||
44 | 44 | return; |
45 | 45 | } |
46 | 46 | if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) { |
47 | - throw new \RuntimeException('You don\'t have permissions to write CSV report in ' . $logFile); |
|
47 | + throw new \RuntimeException('You don\'t have permissions to write CSV report in '.$logFile); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | $availables = (new Registry())->allForStructures(); |
@@ -42,7 +42,7 @@ |
||
42 | 42 | return; |
43 | 43 | } |
44 | 44 | if (!file_exists(dirname($logFile)) || !is_writable(dirname($logFile))) { |
45 | - throw new \RuntimeException('You don\'t have permissions to write JSON report in ' . $logFile); |
|
45 | + throw new \RuntimeException('You don\'t have permissions to write JSON report in '.$logFile); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | file_put_contents($logFile, json_encode($metrics, JSON_PRETTY_PRINT)); |
@@ -78,7 +78,7 @@ |
||
78 | 78 | $metrics = new Metrics(); |
79 | 79 | |
80 | 80 | // traverse all |
81 | - $whenToStop = function () { |
|
81 | + $whenToStop = function() { |
|
82 | 82 | return true; |
83 | 83 | }; |
84 | 84 |
@@ -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; |
@@ -18,10 +18,10 @@ |
||
18 | 18 | |
19 | 19 | public function apply(Metric $metric) |
20 | 20 | { |
21 | - if (! $metric instanceof PackageMetric) { |
|
21 | + if (!$metric instanceof PackageMetric) { |
|
22 | 22 | return; |
23 | 23 | } |
24 | - if (abs($metric->getDistance()) > sqrt(2)/4) { |
|
24 | + if (abs($metric->getDistance()) > sqrt(2) / 4) { |
|
25 | 25 | $this->metric = $metric; |
26 | 26 | $metric->get('violations')->add($this); |
27 | 27 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function apply(Metric $metric) |
27 | 27 | { |
28 | - if (! $metric instanceof ClassMetric) { |
|
28 | + if (!$metric instanceof ClassMetric) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 |
@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | public function apply(Metric $metric) |
27 | 27 | { |
28 | - if (! $metric instanceof ClassMetric) { |
|
28 | + if (!$metric instanceof ClassMetric) { |
|
29 | 29 | return; |
30 | 30 | } |
31 | 31 |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | |
73 | 73 | // JUNIT format |
74 | 74 | foreach ($xpath->query('//testsuite[@file]') as $suite) { |
75 | - array_push($testsuites, (object)[ |
|
75 | + array_push($testsuites, (object) [ |
|
76 | 76 | 'file' => $suite->getAttribute('file'), |
77 | 77 | 'name' => $suite->getAttribute('name'), |
78 | 78 | 'assertions' => $suite->getAttribute('assertions'), |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $assertions = $case === $suite->firstChild->nextSibling ? $suite->getAttribute('assertions') : 0; |
102 | 102 | } |
103 | 103 | |
104 | - $testsuites[$case->getAttribute('class')] = (object)[ |
|
104 | + $testsuites[$case->getAttribute('class')] = (object) [ |
|
105 | 105 | 'file' => $case->getAttribute('file'), |
106 | 106 | 'name' => $case->getAttribute('class'), |
107 | 107 | 'assertions' => $assertions, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest)); |
121 | 121 | |
122 | 122 | if (!file_exists($suite->file) || !is_readable($suite->file)) { |
123 | - throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file); |
|
123 | + throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | $code = file_get_contents($suite->file); |
@@ -133,10 +133,10 @@ discard block |
||
133 | 133 | |
134 | 134 | // list of externals sources of unit test |
135 | 135 | $metric = $metricsOfUnitTest->get($suite->name); |
136 | - $externals = (array)$metric->get('externals'); |
|
136 | + $externals = (array) $metric->get('externals'); |
|
137 | 137 | |
138 | 138 | // global stats for each test |
139 | - $infoAboutTests[$suite->name] = (object)[ |
|
139 | + $infoAboutTests[$suite->name] = (object) [ |
|
140 | 140 | 'nbExternals' => count(array_unique($externals)), |
141 | 141 | 'externals' => array_unique($externals), |
142 | 142 | 'filename' => $suite->file, |
@@ -22,7 +22,7 @@ |
||
22 | 22 | $output = new CliOutput(); |
23 | 23 | |
24 | 24 | // issues and debug |
25 | - $issuer = (new Issuer($output));//->enable(); |
|
25 | + $issuer = (new Issuer($output)); //->enable(); |
|
26 | 26 | |
27 | 27 | // config |
28 | 28 | $config = (new Parser())->parse($argv); |