@@ -70,7 +70,7 @@ |
||
| 70 | 70 | */ |
| 71 | 71 | public function getKey(): string |
| 72 | 72 | { |
| 73 | - return $this->getType() . $this->file->getFullPath(); |
|
| 73 | + return $this->getType().$this->file->getFullPath(); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | { |
| 61 | 61 | $output = $process->getOutput(); |
| 62 | 62 | preg_match("/([0-9]{1,})/", $output, $matches); |
| 63 | - if (! isset($matches[1])) { |
|
| 63 | + if (!isset($matches[1])) { |
|
| 64 | 64 | return 0; |
| 65 | 65 | } |
| 66 | 66 | return (integer) $matches[1]; |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | public function __construct() |
| 78 | 78 | { |
| 79 | 79 | parent::__construct(); |
| 80 | - $this->config = new Config(Yaml::parse(@file_get_contents(getcwd() . '/churn.yml')) ?? []); |
|
| 80 | + $this->config = new Config(Yaml::parse(@file_get_contents(getcwd().'/churn.yml')) ?? []); |
|
| 81 | 81 | $this->fileManager = new FileManager($this->config); |
| 82 | 82 | $this->processFactory = new ProcessFactory($this->config); |
| 83 | 83 | $this->resultsParser = new ResultsParser; |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | public function orderByScoreDesc(): self |
| 16 | 16 | { |
| 17 | - return $this->sortByDesc(function (Result $result) { |
|
| 17 | + return $this->sortByDesc(function(Result $result) { |
|
| 18 | 18 | return $result->getScore(); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -41,8 +41,8 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | private function filterByMinScore(int $minScore): Closure |
| 43 | 43 | { |
| 44 | - return function (ResultCollection $results) use ($minScore) { |
|
| 45 | - return $results->filter(function (Result $result) use ($minScore) { |
|
| 44 | + return function(ResultCollection $results) use ($minScore) { |
|
| 45 | + return $results->filter(function(Result $result) use ($minScore) { |
|
| 46 | 46 | return $result->getScore() >= $minScore; |
| 47 | 47 | }); |
| 48 | 48 | }; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | public function createVcsCommitProcess(File $file): ChurnProcess |
| 35 | 35 | { |
| 36 | - $process = new Process($this->getVscCommand($file) . ' | sort | uniq -c | sort -nr'); |
|
| 36 | + $process = new Process($this->getVscCommand($file).' | sort | uniq -c | sort -nr'); |
|
| 37 | 37 | |
| 38 | 38 | return new ChurnProcess($file, $process, 'VcsCommitProcess'); |
| 39 | 39 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | public function createCyclomaticComplexityProcess(File $file): ChurnProcess |
| 47 | 47 | { |
| 48 | - $rootFolder = __DIR__ . '/../../'; |
|
| 48 | + $rootFolder = __DIR__.'/../../'; |
|
| 49 | 49 | |
| 50 | 50 | $process = new Process( |
| 51 | 51 | "php {$rootFolder}CyclomaticComplexityAssessorRunner {$file->getFullPath()}" |
@@ -62,16 +62,16 @@ discard block |
||
| 62 | 62 | break; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if (is_dir($dir . '/.git')) { |
|
| 66 | - return 'git log --since="' . $this->config->getCommitsSince() . '" --name-only --pretty=format: ' . $file->getFullPath(); |
|
| 67 | - } elseif (is_dir($dir . '/.hg')) { |
|
| 65 | + if (is_dir($dir.'/.git')) { |
|
| 66 | + return 'git log --since="'.$this->config->getCommitsSince().'" --name-only --pretty=format: '.$file->getFullPath(); |
|
| 67 | + } elseif (is_dir($dir.'/.hg')) { |
|
| 68 | 68 | $since = date('Y-m-d', strtotime($this->config->getCommitsSince())); |
| 69 | - return 'hg log ' . $file->getFullPath() . ' --date "' . $since . ' to now" --template "' . $file->getDisplayPath() . '\n"'; |
|
| 69 | + return 'hg log '.$file->getFullPath().' --date "'.$since.' to now" --template "'.$file->getDisplayPath().'\n"'; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | $path = $dir; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - throw new \InvalidArgumentException($file->getFullPath() . ' is not located in a known VCS'); |
|
| 75 | + throw new \InvalidArgumentException($file->getFullPath().' is not located in a known VCS'); |
|
| 76 | 76 | } |
| 77 | 77 | } |