Completed
Pull Request — master (#213)
by Théo
08:21
created
compatibility.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
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
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/Analyze/FileAnalyzer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/Analyze/LcomAnalyzer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/DoAggregatedAnalyze.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
52 52
 
53 53
 
54 54
     /**
55
-    * @inheritdoc
56
-    */
55
+     * @inheritdoc
56
+     */
57 57
     public function execute(ResultCollection $collection, ResultCollection $aggregatedResults) {
58 58
 
59 59
         $this->output->write(str_pad("\x0DGrouping results by package/directory. This will take few minutes...", 80, "\x20"));
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
             }
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/DoAnalyze.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/Queue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/ReportRenderer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/ReportWriter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@
 block discarded – undo
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()));
Please login to merge, or discard this patch.
src/Hal/Application/Command/RunMetricsCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                     'path', InputArgument::OPTIONAL, 'Path to explore'
39 39
                 )
40 40
                 ->addOption(
41
-                    'report-html',null, InputOption::VALUE_REQUIRED, 'Path to save report in HTML format. Example: /tmp/report.html'
41
+                    'report-html', null, InputOption::VALUE_REQUIRED, 'Path to save report in HTML format. Example: /tmp/report.html'
42 42
                 )
43 43
                 ->addOption(
44 44
                     'report-xml', null, InputOption::VALUE_REQUIRED, 'Path to save summary report in XML format. Example: /tmp/report.xml'
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $config = $configFactory->factory($input);
103 103
 
104 104
         // files
105
-        if(null === $config->getPath()->getBasePath()) {
105
+        if (null === $config->getPath()->getBasePath()) {
106 106
             throw new \LogicException('Please provide a path to analyze');
107 107
         }
108 108
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         // evaluation of success
131 131
         $rule = $config->getFailureCondition();
132
-        if(null !== $rule) {
132
+        if (null !== $rule) {
133 133
             $evaluator = new Evaluator($collection, $aggregatedResults, $bounds);
134 134
             $result = $evaluator->evaluate($rule);
135 135
             // fail if failure-condition is realized
Please login to merge, or discard this patch.