Completed
Pull Request — master (#226)
by Oskar
03:03
created
src/Hal/Metrics/Design/Component/MaintainabilityIndex/Result.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,10 +60,10 @@
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/Hal/Metrics/Mood/Abstractness/Abstractness.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 
29 29
         $ac = $cc = $abstractness = 0;
30 30
 
31
-        foreach($results as $result) {
31
+        foreach ($results as $result) {
32 32
             $rOOP = $result->getOOP();
33
-            if(is_object($rOOP)) {
33
+            if (is_object($rOOP)) {
34 34
                 $cc += sizeof($rOOP->getConcreteClasses(), COUNT_NORMAL);
35 35
                 $ac += sizeof($rOOP->getAbstractClasses(), COUNT_NORMAL);
36 36
             }
37 37
         }
38 38
 
39 39
         $result = new Result;
40
-        if($ac + $cc > 0) {
40
+        if ($ac + $cc > 0) {
41 41
             $abstractness = round($ac / ($ac + $cc), 2);
42 42
         }
43 43
         $result->setAbstractness($abstractness);
Please login to merge, or discard this patch.
src/Hal/Metrics/Mood/Instability/Instability.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,16 +28,16 @@
 block discarded – undo
28 28
 
29 29
         $ca = $ce = $i = 0;
30 30
 
31
-        foreach($results as $result) {
31
+        foreach ($results as $result) {
32 32
             $r = $result->getCoupling();
33
-            if(is_object($r)) {
33
+            if (is_object($r)) {
34 34
                 $ce += $r->getEfferentCoupling();
35 35
                 $ca += $r->getAfferentCoupling();
36 36
             }
37 37
         }
38 38
 
39 39
         $result = new Result;
40
-        if($ca + $ce > 0) {
40
+        if ($ca + $ce > 0) {
41 41
             $i = round($ce / ($ca + $ce), 2);
42 42
         }
43 43
         $result->setInstability($i);
Please login to merge, or discard this patch.
src/Hal/Application/Command/Job/Analyze/CardAndAgrestiAnalyzer.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/Analyze/CouplingAnalyzer.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/Metrics/Complexity/Component/McCabe/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
src/Hal/Metrics/Complexity/Component/Myer/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
src/Hal/Metrics/Complexity/Structural/LCOM/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
artifacts/phar/build.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 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;
6
-  exit(1);
5
+    echo '[ERROR] It\'s required to run "composer install" before building PhpMetrics!' . PHP_EOL;
6
+    exit(1);
7 7
 }
8 8
 
9 9
 $filename = 'build/phpmetrics.phar';
Please login to merge, or discard this 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.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,9 @@
 block discarded – undo
19 19
 $files = array_merge(rglob('*.php'), rglob('*.twig'), rglob('*.json'), rglob('*.pp'));
20 20
 $exclude = '!(.git)|(.svn)|(bin)|(tests)|(Tests)|(phpmetrics)!';
21 21
 foreach($files as $file) {
22
-    if(preg_match($exclude, $file)) continue;
22
+    if(preg_match($exclude, $file)) {
23
+        continue;
24
+    }
23 25
     $path = str_replace(__DIR__.'/', '', $file);
24 26
     $phar->addFromString($path, file_get_contents($file));
25 27
 }
Please login to merge, or discard this patch.