@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $string = ''; |
46 | 46 | foreach ($this->data as $violation) { |
47 | - $string .= $violation->getName() . ','; |
|
47 | + $string .= $violation->getName().','; |
|
48 | 48 | } |
49 | 49 | return $string; |
50 | 50 | } |
@@ -1,4 +1,4 @@ discard block |
||
1 | -<?php require __DIR__ . '/_header.php'; ?> |
|
1 | +<?php require __DIR__.'/_header.php'; ?> |
|
2 | 2 | |
3 | 3 | <div class="row"> |
4 | 4 | <div class="column"> |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | </div> |
40 | 40 | |
41 | -<?php require __DIR__ . '/_footer.php'; ?> |
|
41 | +<?php require __DIR__.'/_footer.php'; ?> |
|
42 | 42 | |
43 | 43 | |
44 | 44 | <script type="text/javascript"> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -chdir(__DIR__ . '/../../'); |
|
2 | +chdir(__DIR__.'/../../'); |
|
3 | 3 | |
4 | 4 | if (!file_exists('vendor/autoload.php')) { |
5 | - echo '[ERROR] It\'s required to run "composer install" before building PhpMetrics!' . PHP_EOL; |
|
5 | + echo '[ERROR] It\'s required to run "composer install" before building PhpMetrics!'.PHP_EOL; |
|
6 | 6 | exit(1); |
7 | 7 | } |
8 | 8 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | if (preg_match($exclude, $file)) { |
22 | 22 | continue; |
23 | 23 | } |
24 | - $path = str_replace(__DIR__ . '/', '', $file); |
|
24 | + $path = str_replace(__DIR__.'/', '', $file); |
|
25 | 25 | $phar->addFromString($path, file_get_contents($file)); |
26 | 26 | } |
27 | 27 | |
@@ -52,8 +52,8 @@ discard block |
||
52 | 52 | |
53 | 53 | function rglob($pattern = '*', $flags = 0, $path = '') |
54 | 54 | { |
55 | - $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT); |
|
56 | - $files = glob($path . $pattern, $flags); |
|
55 | + $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); |
|
56 | + $files = glob($path.$pattern, $flags); |
|
57 | 57 | foreach ($paths as $path) { |
58 | 58 | $files = array_merge($files, rglob($pattern, $flags, $path)); |
59 | 59 | } |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // sums |
69 | - $sum = (object)[ |
|
69 | + $sum = (object) [ |
|
70 | 70 | 'loc' => 0, |
71 | 71 | 'cloc' => 0, |
72 | 72 | 'lloc' => 0, |
73 | 73 | 'nbMethods' => 0, |
74 | 74 | ]; |
75 | - $avg = (object)[ |
|
75 | + $avg = (object) [ |
|
76 | 76 | 'ccn' => [], |
77 | 77 | 'bugs' => [], |
78 | 78 | 'kanDefect' => [], |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $violations[$name]++; |
133 | 133 | } |
134 | 134 | } |
135 | - $sum->violations = (object)$violations; |
|
135 | + $sum->violations = (object) $violations; |
|
136 | 136 | |
137 | 137 | $this->avg = $avg; |
138 | 138 | $this->sum = $sum; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | // JUNIT format |
82 | 82 | foreach ($xpath->query('//testsuite[@file]') as $suite) { |
83 | - $testsuites[] = (object)[ |
|
83 | + $testsuites[] = (object) [ |
|
84 | 84 | 'file' => $suite->getAttribute('file'), |
85 | 85 | 'name' => $suite->getAttribute('name'), |
86 | 86 | 'assertions' => $suite->getAttribute('assertions'), |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | } |
111 | 111 | |
112 | 112 | $attributeClass = $case->getAttribute('class'); |
113 | - $testsuites[$attributeClass] = (object)[ |
|
113 | + $testsuites[$attributeClass] = (object) [ |
|
114 | 114 | 'file' => $case->getAttribute('file'), |
115 | 115 | 'name' => $attributeClass, |
116 | 116 | 'assertions' => $assertions, |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest)); |
130 | 130 | |
131 | 131 | if (!\file_exists($suite->file) || !\is_readable($suite->file)) { |
132 | - throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file); |
|
132 | + throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | $code = \file_get_contents($suite->file); |
@@ -142,10 +142,10 @@ discard block |
||
142 | 142 | |
143 | 143 | // list of externals sources of unit test |
144 | 144 | $metric = $metricsOfUnitTest->get($suite->name); |
145 | - $externals = (array)$metric->get('externals'); |
|
145 | + $externals = (array) $metric->get('externals'); |
|
146 | 146 | |
147 | 147 | // global stats for each test |
148 | - $infoAboutTests[$suite->name] = (object)[ |
|
148 | + $infoAboutTests[$suite->name] = (object) [ |
|
149 | 149 | 'nbExternals' => \count(\array_unique($externals)), |
150 | 150 | 'externals' => \array_unique($externals), |
151 | 151 | 'filename' => $suite->file, |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | foreach ($rawRequirements as $requirement => $version) { |
47 | 47 | $package = $packagist->get($requirement); |
48 | 48 | |
49 | - $packages[$requirement] = (object)[ |
|
49 | + $packages[$requirement] = (object) [ |
|
50 | 50 | 'name' => $requirement, |
51 | 51 | 'required' => $version, |
52 | 52 | 'installed' => isset($rawInstalled[$requirement]) ? $rawInstalled[$requirement] : null, |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | if (!\preg_match('/composer(-dist)?\.json/', $filename)) { |
78 | 78 | continue; |
79 | 79 | } |
80 | - $composerJson = (object)\json_decode(\file_get_contents($filename)); |
|
80 | + $composerJson = (object) \json_decode(\file_get_contents($filename)); |
|
81 | 81 | |
82 | 82 | if (!isset($composerJson->require)) { |
83 | 83 | continue; |
84 | 84 | } |
85 | 85 | |
86 | - $rawRequirements[] = (array)$composerJson->require; |
|
86 | + $rawRequirements[] = (array) $composerJson->require; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | return \call_user_func_array('\array_merge', $rawRequirements); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | if (false === \strpos($filename, 'composer.lock')) { |
108 | 108 | continue; |
109 | 109 | } |
110 | - $composerLockJson = (object)\json_decode(\file_get_contents($filename)); |
|
110 | + $composerLockJson = (object) \json_decode(\file_get_contents($filename)); |
|
111 | 111 | |
112 | 112 | if (!isset($composerLockJson->packages)) { |
113 | 113 | continue; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // get latest version |
37 | 37 | $latest = '0.0.0'; |
38 | - foreach ((array)$json->package->versions as $version => $datas) { |
|
38 | + foreach ((array) $json->package->versions as $version => $datas) { |
|
39 | 39 | $version = \preg_replace('([^\.\d])', '', $version); |
40 | 40 | if (!\preg_match('!\d+\.\d+\.\d+!', $version)) { |
41 | 41 | continue; |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | // build a fingerprint of the given method |
51 | 51 | $fingerprintOfMethod = []; |
52 | - \iterate_over_node($node, function ($node) use (&$fingerprintOfMethod) { |
|
52 | + \iterate_over_node($node, function($node) use (&$fingerprintOfMethod) { |
|
53 | 53 | |
54 | 54 | // avoid cast |
55 | 55 | if ($node instanceof Cast) { |
@@ -17,7 +17,6 @@ |
||
17 | 17 | public static function getName(Node $node) |
18 | 18 | { |
19 | 19 | return ($node instanceof Node\Stmt\Class_ && $node->isAnonymous()) ? |
20 | - 'anonymous@' . \spl_object_hash($node) : |
|
21 | - $node->namespacedName->toString(); |
|
20 | + 'anonymous@'.\spl_object_hash($node) : $node->namespacedName->toString(); |
|
22 | 21 | } |
23 | 22 | } |