Completed
Pull Request — master (#283)
by Oskar
04:36
created
src/Hal/Metric/Package/PackageCollectingVisitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@
 block discarded – undo
42 42
                 $package = $matches[1];
43 43
             }
44 44
             if (preg_match('/^\s*\* @subpackage (.*)/m', $docBlockText, $matches)) {
45
-                $package = $package . '\\' . $matches[1];
45
+                $package = $package.'\\'.$matches[1];
46 46
             }
47 47
 
48
-            $packageName = $package . '\\';
49
-            if (! $packageMetric = $this->metrics->get($packageName)) {
48
+            $packageName = $package.'\\';
49
+            if (!$packageMetric = $this->metrics->get($packageName)) {
50 50
                 $packageMetric = new PackageMetric($packageName);
51 51
                 $this->metrics->attach($packageMetric);
52 52
             }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageDependencies.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function calculate(Metrics $metrics)
14 14
     {
15
-        $classes = array_filter($metrics->all(), function (Metric $metric) {
15
+        $classes = array_filter($metrics->all(), function(Metric $metric) {
16 16
             return $metric instanceof ClassMetric || $metric instanceof InterfaceMetric;
17 17
         });
18 18
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     private function increaseDependencies(Metric $class, Metrics $metrics)
25 25
     {
26
-        if (! $class->has('package') || ! $class->has('externals')) {
26
+        if (!$class->has('package') || !$class->has('externals')) {
27 27
             return;
28 28
         }
29 29
         $incomingPackage = $metrics->get($class->get('package')); /* @var $incomingPackage PackageMetric */
@@ -53,6 +53,6 @@  discard block
 block discarded – undo
53 53
         }
54 54
         $parts = explode('\\', $className);
55 55
         array_pop($parts);
56
-        return implode('\\', $parts) . '\\';
56
+        return implode('\\', $parts).'\\';
57 57
     }
58 58
 }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageDistance.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-declare(strict_types=1);
2
+declare(strict_types = 1);
3 3
 namespace Hal\Metric\Package;
4 4
 
5 5
 use Hal\Metric\Metrics;
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function calculate(Metrics $metrics)
11 11
     {
12 12
         foreach ($metrics->all() as $each) {
13
-            if ($each instanceof PackageMetric &&$each->getAbstraction() !== null && $each->getInstability() !== null) {
13
+            if ($each instanceof PackageMetric && $each->getAbstraction() !== null && $each->getInstability() !== null) {
14 14
                 $each->setNormalizedDistance($each->getAbstraction() + $each->getInstability() - 1);
15 15
             }
16 16
         }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageInstability.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function calculate(Metrics $metrics)
11 11
     {
12 12
         /* @var $packages PackageMetric[] */
13
-        $packages = array_filter($metrics->all(), function ($metric) {
13
+        $packages = array_filter($metrics->all(), function($metric) {
14 14
             return $metric instanceof PackageMetric;
15 15
         });
16 16
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
         // Set depending instabilities
31 31
         foreach ($packages as $eachPackage) {
32
-            $dependentInstabilities = array_map(function ($packageName) use ($instabilitiesByPackage) {
32
+            $dependentInstabilities = array_map(function($packageName) use ($instabilitiesByPackage) {
33 33
                 return isset($instabilitiesByPackage[$packageName]) ? $instabilitiesByPackage[$packageName] : null;
34 34
             }, $eachPackage->getOutgoingPackageDependencies());
35 35
             $dependentInstabilities = array_combine(
Please login to merge, or discard this patch.