Completed
Pull Request — master (#403)
by
unknown
01:47
created
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
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         }
29 29
         // Set depending instabilities
30 30
         foreach ($packages as $eachPackage) {
31
-            $dependentInstabilities = array_map(function ($packageName) use ($instabilitiesByPackage) {
31
+            $dependentInstabilities = array_map(function($packageName) use ($instabilitiesByPackage) {
32 32
                 return isset($instabilitiesByPackage[$packageName]) ? $instabilitiesByPackage[$packageName] : null;
33 33
             }, $eachPackage->getOutgoingPackageDependencies());
34 34
             $dependentInstabilities = array_combine(
Please login to merge, or discard this patch.
src/Hal/Metric/Helper/MetricClassNameGenerator.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
     public static function getName(Node $node)
18 18
     {
19 19
         return ($node instanceof Node\Stmt\Class_ && $node->isAnonymous()) ?
20
-            'anonymous@' . spl_object_hash($node) :
21
-            $node->namespacedName->toString();
20
+            'anonymous@'.spl_object_hash($node) : $node->namespacedName->toString();
22 21
     }
23 22
 }
Please login to merge, or discard this patch.
src/Hal/Application/Analyze.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
         $metrics = new Metrics();
79 79
 
80 80
         // traverse all
81
-        $whenToStop = function () {
81
+        $whenToStop = function() {
82 82
             return true;
83 83
         };
84 84
 
Please login to merge, or discard this patch.
src/Hal/Component/Tree/GraphDeduplicated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      */
28 28
     public function addEdge(Node $from, Node $to)
29 29
     {
30
-        $key = $from->getUniqueId() . '->' . $to->getUniqueId();
30
+        $key = $from->getUniqueId().'->'.$to->getUniqueId();
31 31
 
32 32
         if (isset($this->edgesMap[$key])) {
33 33
             return $this;
Please login to merge, or discard this patch.
src/Hal/Violation/Package/StableAbstractionsPrinciple.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
 
19 19
     public function apply(Metric $metric)
20 20
     {
21
-        if (! $metric instanceof PackageMetric) {
21
+        if (!$metric instanceof PackageMetric) {
22 22
             return;
23 23
         }
24
-        if (abs($metric->getDistance()) > sqrt(2)/4) {
24
+        if (abs($metric->getDistance()) > sqrt(2) / 4) {
25 25
             $this->metric = $metric;
26 26
             $metric->get('violations')->add($this);
27 27
         }
Please login to merge, or discard this patch.
src/Hal/Violation/Class_/TooComplexMethodCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     public function apply(Metric $metric)
27 27
     {
28
-        if (! $metric instanceof ClassMetric) {
28
+        if (!$metric instanceof ClassMetric) {
29 29
             return;
30 30
         }
31 31
 
Please login to merge, or discard this patch.
src/Hal/Violation/Class_/TooComplexClassCode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 
26 26
     public function apply(Metric $metric)
27 27
     {
28
-        if (! $metric instanceof ClassMetric) {
28
+        if (!$metric instanceof ClassMetric) {
29 29
             return;
30 30
         }
31 31
 
Please login to merge, or discard this patch.
src/Hal/Metric/System/UnitTesting/UnitTesting.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 
73 73
         // JUNIT format
74 74
         foreach ($xpath->query('//testsuite[@file]') as $suite) {
75
-            array_push($testsuites, (object)[
75
+            array_push($testsuites, (object) [
76 76
                 'file' => $suite->getAttribute('file'),
77 77
                 'name' => $suite->getAttribute('name'),
78 78
                 'assertions' => $suite->getAttribute('assertions'),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 $assertions = $case === $suite->firstChild->nextSibling ? $suite->getAttribute('assertions') : 0;
102 102
             }
103 103
 
104
-            $testsuites[$case->getAttribute('class')] = (object)[
104
+            $testsuites[$case->getAttribute('class')] = (object) [
105 105
                 'file' => $case->getAttribute('file'),
106 106
                 'name' => $case->getAttribute('class'),
107 107
                 'assertions' => $assertions,
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             $traverser->addVisitor(new ExternalsVisitor($metricsOfUnitTest));
121 121
 
122 122
             if (!file_exists($suite->file) || !is_readable($suite->file)) {
123
-                throw new \LogicException('Cannot find source file referenced in testsuite: ' . $suite->file);
123
+                throw new \LogicException('Cannot find source file referenced in testsuite: '.$suite->file);
124 124
             }
125 125
 
126 126
             $code = file_get_contents($suite->file);
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
 
134 134
             // list of externals sources of unit test
135 135
             $metric = $metricsOfUnitTest->get($suite->name);
136
-            $externals = (array)$metric->get('externals');
136
+            $externals = (array) $metric->get('externals');
137 137
 
138 138
             // global stats for each test
139
-            $infoAboutTests[$suite->name] = (object)[
139
+            $infoAboutTests[$suite->name] = (object) [
140 140
                 'nbExternals' => count(array_unique($externals)),
141 141
                 'externals' => array_unique($externals),
142 142
                 'filename' => $suite->file,
Please login to merge, or discard this patch.
src/Hal/Component/File/Finder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -71,15 +71,15 @@
 block discarded – undo
71 71
         $files = [];
72 72
         foreach ($paths as $path) {
73 73
             if (is_dir($path)) {
74
-                $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
74
+                $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
75 75
                 $directory = new RecursiveDirectoryIterator($path, $this->flags);
76 76
                 $iterator = new RecursiveIteratorIterator($directory);
77 77
 
78 78
                 $filterRegex = sprintf(
79 79
                     '`^%s%s%s$`',
80 80
                     preg_quote($path, '`'),
81
-                    !empty($this->excludedDirs) ? '((?!' . implode('|', array_map('preg_quote', $this->excludedDirs)) . ').)+' : '.+',
82
-                    '\.(' . implode('|', $this->extensions) . ')'
81
+                    !empty($this->excludedDirs) ? '((?!'.implode('|', array_map('preg_quote', $this->excludedDirs)).').)+' : '.+',
82
+                    '\.('.implode('|', $this->extensions).')'
83 83
                 );
84 84
 
85 85
                 $filteredIterator = new RegexIterator(
Please login to merge, or discard this patch.