Completed
Push — master ( 01736a...256029 )
by personal
11:20 queued 08:28
created
build.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
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 1 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.