@@ -83,7 +83,7 @@ |
||
83 | 83 | /** |
84 | 84 | * Clean php source |
85 | 85 | * |
86 | - * @param $content |
|
86 | + * @param string $content |
|
87 | 87 | * @return string |
88 | 88 | */ |
89 | 89 | private function cleanup($content) { |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | // PHP 7 |
3 | -defined('T_SPACESHIP') ||define('T_SPACESHIP', '<=>'); // 289 |
|
4 | -defined('T_COALESCE') ||define('T_COALESCE', '??'); // 282 |
|
5 | 3 | \ No newline at end of file |
4 | +defined('T_SPACESHIP') || define('T_SPACESHIP', '<=>'); // 289 |
|
5 | +defined('T_COALESCE') || define('T_COALESCE', '??'); // 282 |
|
6 | 6 | \ No newline at end of file |
@@ -134,7 +134,7 @@ |
||
134 | 134 | ->setHalstead($rHalstead) |
135 | 135 | ->setMaintainabilityIndex($rMaintainability); |
136 | 136 | |
137 | - if($this->withOOP) { |
|
137 | + if ($this->withOOP) { |
|
138 | 138 | $rOOP = $this->extractor->extract($filename); |
139 | 139 | $this->classMap->push($filename, $rOOP); |
140 | 140 | $resultSet->setOOP($rOOP); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | public function execute(array $files) { |
49 | 49 | $fileCoupling = new FileLackOfCohesionOfMethods($this->classMap); |
50 | - foreach($files as $filename) { |
|
50 | + foreach ($files as $filename) { |
|
51 | 51 | $result = $fileCoupling->calculate($filename); |
52 | 52 | $this->collection->get($filename)->setLcom($result); |
53 | 53 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function __construct(OutputInterface $output, Aggregator $aggregator) |
48 | 48 | { |
49 | - $this->aggregator= $aggregator; |
|
49 | + $this->aggregator = $aggregator; |
|
50 | 50 | $this->output = $output; |
51 | 51 | } |
52 | 52 | |
@@ -66,12 +66,12 @@ discard block |
||
66 | 66 | $bounds = new Bounds(); |
67 | 67 | $instability = new Instability(); |
68 | 68 | |
69 | - foreach($groupedResults as $namespace => $results) { |
|
69 | + foreach ($groupedResults as $namespace => $results) { |
|
70 | 70 | |
71 | 71 | // we filter aggregates to conserve only direct results |
72 | 72 | $childs = new ResultCollection(); |
73 | - foreach($results as $r) { |
|
74 | - if($namespace === dirname($r->getName())) { |
|
73 | + foreach ($results as $r) { |
|
74 | + if ($namespace === dirname($r->getName())) { |
|
75 | 75 | $childs->push($r); |
76 | 76 | } |
77 | 77 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | $files = $this->finder->find($this->path); |
94 | 94 | |
95 | - if(0 == sizeof($files, COUNT_NORMAL)) { |
|
95 | + if (0 == sizeof($files, COUNT_NORMAL)) { |
|
96 | 96 | throw new \LogicException('No file found'); |
97 | 97 | } |
98 | 98 | |
@@ -116,12 +116,12 @@ discard block |
||
116 | 116 | , $classMap |
117 | 117 | ); |
118 | 118 | |
119 | - foreach($files as $k => $filename) { |
|
119 | + foreach ($files as $k => $filename) { |
|
120 | 120 | |
121 | 121 | $progress->advance(); |
122 | 122 | |
123 | 123 | // Integrity |
124 | - if(!$this->ignoreErrors && !$syntaxChecker->isCorrect($filename)) { |
|
124 | + if (!$this->ignoreErrors && !$syntaxChecker->isCorrect($filename)) { |
|
125 | 125 | $this->output->writeln(sprintf('<error>file %s is not valid and has been skipped</error>', $filename)); |
126 | 126 | unset($files[$k]); |
127 | 127 | continue; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | // Analyze |
131 | 131 | try { |
132 | 132 | $resultSet = $fileAnalyzer->execute($filename); |
133 | - } catch(NoTokenizableException $e) { |
|
133 | + } catch (NoTokenizableException $e) { |
|
134 | 134 | $this->output->writeln(sprintf("<error>file %s has been skipped: \n%s</error>", $filename, $e->getMessage())); |
135 | 135 | unset($files[$k]); |
136 | 136 | continue; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $progress->finish(); |
152 | 152 | |
153 | 153 | |
154 | - if($this->withOOP) { |
|
154 | + if ($this->withOOP) { |
|
155 | 155 | // COUPLING (should be done after parsing files) |
156 | 156 | $this->output->write(str_pad("\x0DAnalyzing coupling. This will take few minutes...", 80, "\x20")); |
157 | 157 | $couplingAnalyzer = new CouplingAnalyzer($classMap, $collection); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | * @inheritdoc |
48 | 48 | */ |
49 | 49 | public function execute(ResultCollection $collection, ResultCollection $aggregatedResults) { |
50 | - foreach($this->jobs as $job) { |
|
50 | + foreach ($this->jobs as $job) { |
|
51 | 51 | $job->execute($collection, $aggregatedResults); |
52 | 52 | } |
53 | 53 | } |
@@ -60,7 +60,7 @@ |
||
60 | 60 | * @inheritdoc |
61 | 61 | */ |
62 | 62 | public function execute(ResultCollection $collection, ResultCollection $aggregatedResults) { |
63 | - if(!$this->enabled) { |
|
63 | + if (!$this->enabled) { |
|
64 | 64 | return; |
65 | 65 | } |
66 | 66 |
@@ -61,12 +61,12 @@ |
||
61 | 61 | * @inheritdoc |
62 | 62 | */ |
63 | 63 | public function execute(ResultCollection $collection, ResultCollection $aggregatedResults) { |
64 | - if(!$this->destination) { |
|
64 | + if (!$this->destination) { |
|
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | 68 | $dir = dirname($this->destination); |
69 | - if(!file_exists($dir)) { |
|
69 | + if (!file_exists($dir)) { |
|
70 | 70 | mkdir($dir, 0777, true); |
71 | 71 | } |
72 | 72 | $this->output->writeln(sprintf('Generating %s Report...', $this->formater->getName())); |