@@ -36,7 +36,7 @@ |
||
36 | 36 | |
37 | 37 | |
38 | 38 | $sy = $dc = $sc = array(); // in system |
39 | - foreach($class->getMethods() as $method) { |
|
39 | + foreach ($class->getMethods() as $method) { |
|
40 | 40 | $fanout = sizeof($method->getDependencies(), COUNT_NORMAL); |
41 | 41 | $v = sizeof($method->getArguments(), COUNT_NORMAL) + sizeof($method->getReturns(), COUNT_NORMAL); |
42 | 42 |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | 51 | public function asArray() { |
52 | - return array ( |
|
52 | + return array( |
|
53 | 53 | 'loc' => $this->getLoc() |
54 | 54 | ,'logicalLoc' => $this->getLogicalLoc() |
55 | 55 | ); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | |
50 | 50 | |
51 | 51 | // comment weight |
52 | - if($rLoc->getLoc() > 0) { |
|
52 | + if ($rLoc->getLoc() > 0) { |
|
53 | 53 | $CM = $rLoc->getCommentLoc() / $rLoc->getLoc(); |
54 | 54 | $result->setCommentWeight( |
55 | 55 | 50 * sin(sqrt(2.4 * $CM)) |
@@ -60,10 +60,10 @@ |
||
60 | 60 | */ |
61 | 61 | public function setMaintainabilityIndexWithoutComment($maintainabilityIndexWithoutComment) |
62 | 62 | { |
63 | - if(is_infinite($maintainabilityIndexWithoutComment)) { |
|
63 | + if (is_infinite($maintainabilityIndexWithoutComment)) { |
|
64 | 64 | $maintainabilityIndexWithoutComment = 171; |
65 | 65 | } |
66 | - $this->maintainabilityIndexWithoutComment = round($maintainabilityIndexWithoutComment,2); |
|
66 | + $this->maintainabilityIndexWithoutComment = round($maintainabilityIndexWithoutComment, 2); |
|
67 | 67 | |
68 | 68 | } |
69 | 69 | /** |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | 51 | public function asArray() { |
52 | - return array ( |
|
52 | + return array( |
|
53 | 53 | 'loc' => $this->getLoc() |
54 | 54 | ,'logicalLoc' => $this->getLogicalLoc() |
55 | 55 | ); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | 51 | public function asArray() { |
52 | - return array ( |
|
52 | + return array( |
|
53 | 53 | 'loc' => $this->getLoc() |
54 | 54 | ,'logicalLoc' => $this->getLogicalLoc() |
55 | 55 | ); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | * @inheritdoc |
50 | 50 | */ |
51 | 51 | public function asArray() { |
52 | - return array ( |
|
52 | + return array( |
|
53 | 53 | 'loc' => $this->getLoc() |
54 | 54 | ,'logicalLoc' => $this->getLogicalLoc() |
55 | 55 | ); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 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 | |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | |
19 | 19 | $files = array_merge(rglob('*.php'), rglob('*.twig'), rglob('*.json'), rglob('*.pp')); |
20 | 20 | $exclude = '!(.git)|(.svn)|(bin)|(tests)|(Tests)|(phpmetrics)!'; |
21 | -foreach($files as $file) { |
|
22 | - if(preg_match($exclude, $file)) continue; |
|
21 | +foreach ($files as $file) { |
|
22 | + if (preg_match($exclude, $file)) continue; |
|
23 | 23 | $path = str_replace(__DIR__.'/', '', $file); |
24 | 24 | $phar->addFromString($path, file_get_contents($file)); |
25 | 25 | } |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | |
51 | 51 | chmod($filename, 0755); |
52 | 52 | |
53 | -function rglob($pattern='*', $flags = 0, $path='') |
|
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); |
|
57 | - foreach ($paths as $path) { $files=array_merge($files,rglob($pattern, $flags, $path)); } |
|
55 | + $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT); |
|
56 | + $files = glob($path.$pattern, $flags); |
|
57 | + foreach ($paths as $path) { $files = array_merge($files, rglob($pattern, $flags, $path)); } |
|
58 | 58 | return $files; |
59 | 59 | } |
60 | 60 | \ No newline at end of file |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | $code = preg_replace('!(\}|\)|;)\?!', '$1 ?', $code); |
10 | 10 | |
11 | 11 | // remove one line comments |
12 | - $code = preg_replace('!((\/\/|#).*\n)!', Token::T_COMMENT . ' ', $code); |
|
12 | + $code = preg_replace('!((\/\/|#).*\n)!', Token::T_COMMENT.' ', $code); |
|
13 | 13 | |
14 | 14 | // remove EOL |
15 | 15 | $code = preg_replace('!(\s+)!', ' ', $code); |
@@ -37,6 +37,6 @@ discard block |
||
37 | 37 | $code = preg_replace('!return;!i', Token::T_RETURN_VOID, $code); |
38 | 38 | |
39 | 39 | // split tokens |
40 | - return preg_split('!\s|;|,|(\{|\}|\(|\))!', $code, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); |
|
40 | + return preg_split('!\s|;|,|(\{|\}|\(|\))!', $code, null, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); |
|
41 | 41 | } |
42 | 42 | } |
43 | 43 | \ No newline at end of file |