@@ -71,15 +71,15 @@ |
||
71 | 71 | $files = []; |
72 | 72 | foreach ($paths as $path) { |
73 | 73 | if (is_dir($path)) { |
74 | - $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; |
|
74 | + $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR; |
|
75 | 75 | $directory = new RecursiveDirectoryIterator($path, $this->flags); |
76 | 76 | $iterator = new RecursiveIteratorIterator($directory); |
77 | 77 | |
78 | 78 | $filterRegex = sprintf( |
79 | 79 | '`^%s%s%s$`', |
80 | 80 | preg_quote($path, '`'), |
81 | - !empty($this->excludedDirs) ? '((?!' . implode('|', array_map('preg_quote', $this->excludedDirs)) . ').)+' : '.+', |
|
82 | - '\.(' . implode('|', $this->extensions) . ')' |
|
81 | + !empty($this->excludedDirs) ? '((?!'.implode('|', array_map('preg_quote', $this->excludedDirs)).').)+' : '.+', |
|
82 | + '\.('.implode('|', $this->extensions).')' |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | $filteredIterator = new RegexIterator( |
@@ -64,7 +64,7 @@ |
||
64 | 64 | foreach ($node->stmts as $stmt) { |
65 | 65 | if ($stmt instanceof Stmt\ClassMethod) { |
66 | 66 | // iterate over children, recursively |
67 | - $cb = function ($node) use (&$cb) { |
|
67 | + $cb = function($node) use (&$cb) { |
|
68 | 68 | $ccn = 0; |
69 | 69 | |
70 | 70 | foreach (get_object_vars($node) as $name => $member) { |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | foreach ($rawRequirements as $requirement => $version) { |
45 | 45 | $package = $packagist->get($requirement); |
46 | 46 | |
47 | - $packages[$requirement] = (object)[ |
|
47 | + $packages[$requirement] = (object) [ |
|
48 | 48 | 'name' => $requirement, |
49 | 49 | 'required' => $version, |
50 | 50 | 'installed' => isset($rawInstalled[$requirement]) ? $rawInstalled[$requirement] : null, |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | if (!\preg_match('/composer(-dist)?\.json/', $filename)) { |
76 | 76 | continue; |
77 | 77 | } |
78 | - $composerJson = (object)\json_decode(\file_get_contents($filename)); |
|
78 | + $composerJson = (object) \json_decode(\file_get_contents($filename)); |
|
79 | 79 | |
80 | 80 | if (!isset($composerJson->require)) { |
81 | 81 | continue; |
82 | 82 | } |
83 | 83 | |
84 | - $rawRequirements[] = (array)$composerJson->require; |
|
84 | + $rawRequirements[] = (array) $composerJson->require; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | return \call_user_func_array('array_merge', $rawRequirements); |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | if (false === \strpos($filename, 'composer.lock')) { |
106 | 106 | continue; |
107 | 107 | } |
108 | - $composerLockJson = (object)\json_decode(\file_get_contents($filename)); |
|
108 | + $composerLockJson = (object) \json_decode(\file_get_contents($filename)); |
|
109 | 109 | |
110 | 110 | if (!isset($composerLockJson->packages)) { |
111 | 111 | continue; |
@@ -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); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | return |
99 | 99 | 0 >= version_compare( |
100 | 100 | '10.0.10586', |
101 | - PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD |
|
101 | + PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD |
|
102 | 102 | ) |
103 | 103 | || false !== getenv('ANSICON') |
104 | 104 | || 'ON' === getenv('ConEmuANSI') |
@@ -27,7 +27,7 @@ |
||
27 | 27 | public function __construct(Mother $traverser, $stopCondition = null) |
28 | 28 | { |
29 | 29 | if (null === $stopCondition) { |
30 | - $stopCondition = function ($node) { |
|
30 | + $stopCondition = function($node) { |
|
31 | 31 | if ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_) { |
32 | 32 | return false; |
33 | 33 | } |
@@ -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 | 'wmc' => [], |
77 | 77 | 'ccn' => [], |
78 | 78 | 'bugs' => [], |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | $violations[$name]++; |
165 | 165 | } |
166 | 166 | } |
167 | - $sum->violations = (object)$violations; |
|
167 | + $sum->violations = (object) $violations; |
|
168 | 168 | |
169 | 169 | $this->avg = $avg; |
170 | 170 | $this->sum = $sum; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $class->set('interface', true); |
38 | 38 | $class->set('abstract', true); |
39 | 39 | } else { |
40 | - $name = (string)(isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node)); |
|
40 | + $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node)); |
|
41 | 41 | $class = new ClassMetric($name); |
42 | 42 | $class->set('interface', false); |
43 | 43 | $class->set('abstract', $node instanceof Stmt\Trait_ || $node->isAbstract()); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | $roleDetector = new RoleOfMethodDetector(); |
51 | 51 | foreach ($node->stmts as $stmt) { |
52 | 52 | if ($stmt instanceof Stmt\ClassMethod) { |
53 | - $function = new FunctionMetric((string)$stmt->name); |
|
53 | + $function = new FunctionMetric((string) $stmt->name); |
|
54 | 54 | |
55 | 55 | $role = $roleDetector->detects($stmt); |
56 | 56 | $function->set('role', $role); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | public function leaveNode(Node $node) |
48 | 48 | { |
49 | 49 | if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Trait_) { |
50 | - $name = (string)(isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node)); |
|
50 | + $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node)); |
|
51 | 51 | $classOrFunction = $this->metrics->get($name); |
52 | 52 | |
53 | 53 | if (null === $lloc = $classOrFunction->get('lloc')) { |