Completed
Pull Request — master (#448)
by
unknown
08:31
created
phpmetrics/src/Hal/Metric/Consolidated.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
         }
67 67
 
68 68
         // sums
69
-        $sum = (object)[
69
+        $sum = (object) [
70 70
             'loc' => 0,
71 71
             'cloc' => 0,
72 72
             'lloc' => 0,
73 73
             'nbMethods' => 0,
74 74
         ];
75
-        $avg = (object)[
75
+        $avg = (object) [
76 76
             'wmc' => [],
77 77
             'ccn' => [],
78 78
             'bugs' => [],
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 
108 108
         foreach ($avg as &$a) {
109 109
             if (count($a) > 0) {
110
-                $a = round(array_sum((array)$a) / count($a), 2);
110
+                $a = round(array_sum((array) $a) / count($a), 2);
111 111
             } else {
112 112
                 $a = 0;
113 113
             }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
                 $violations[$name]++;
167 167
             }
168 168
         }
169
-        $sum->violations = (object)$violations;
169
+        $sum->violations = (object) $violations;
170 170
 
171 171
         $this->avg = $avg;
172 172
         $this->sum = $sum;
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/Package/PackageDependencies.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     /** @return void */
14 14
     public function calculate(Metrics $metrics)
15 15
     {
16
-        $classes = array_filter($metrics->all(), function (Metric $metric) {
16
+        $classes = array_filter($metrics->all(), function(Metric $metric) {
17 17
             return $metric instanceof ClassMetric || $metric instanceof InterfaceMetric;
18 18
         });
19 19
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     private function increaseDependencies(Metric $class, Metrics $metrics)
32 32
     {
33
-        if (! $class->has('package') || ! $class->has('externals')) {
33
+        if (!$class->has('package') || !$class->has('externals')) {
34 34
             return;
35 35
         }
36 36
         /** @var PackageMetric $incomingPackage */
@@ -66,6 +66,6 @@  discard block
 block discarded – undo
66 66
         }
67 67
         $parts = explode('\\', $className);
68 68
         array_pop($parts);
69
-        return implode('\\', $parts) . '\\';
69
+        return implode('\\', $parts).'\\';
70 70
     }
71 71
 }
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/Package/PackageAbstraction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     public function calculate(Metrics $metrics)
13 13
     {
14 14
         foreach ($metrics->all() as $eachPackage) {
15
-            if (! $eachPackage instanceof PackageMetric) {
15
+            if (!$eachPackage instanceof PackageMetric) {
16 16
                 continue;
17 17
             }
18 18
             $abstractClassCount = 0;
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/Package/PackageCollectingVisitor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
     public function enterNode(Node $node)
29 29
     {
30 30
         if ($node instanceof Namespace_) {
31
-            $this->namespace = (string)$node->name;
31
+            $this->namespace = (string) $node->name;
32 32
         }
33 33
 
34 34
         return null;
@@ -45,17 +45,17 @@  discard block
 block discarded – undo
45 45
                 $package = $matches[1];
46 46
             }
47 47
             if (preg_match('/^\s*\* @subpackage (.*)/m', $docBlockText, $matches)) {
48
-                $package = $package . '\\' . $matches[1];
48
+                $package = $package.'\\'.$matches[1];
49 49
             }
50 50
 
51
-            $packageName = $package . '\\';
52
-            if (! $packageMetric = $this->metrics->get($packageName)) {
51
+            $packageName = $package.'\\';
52
+            if (!$packageMetric = $this->metrics->get($packageName)) {
53 53
                 $packageMetric = new PackageMetric($packageName);
54 54
                 $this->metrics->attach($packageMetric);
55 55
             }
56 56
             /** @var PackageMetric $packageMetric */
57
-            $elementName = isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node);
58
-            $elementName = (string)$elementName;
57
+            $elementName = isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node);
58
+            $elementName = (string) $elementName;
59 59
             $packageMetric->addClass($elementName);
60 60
 
61 61
             $metric = $this->metrics->get($elementName);
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Metric/Package/PackageInstability.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
     public function calculate(Metrics $metrics)
13 13
     {
14 14
         /* @var $packages PackageMetric[] */
15
-        $packages = array_filter($metrics->all(), function ($metric) {
15
+        $packages = array_filter($metrics->all(), function($metric) {
16 16
             return $metric instanceof PackageMetric;
17 17
         });
18 18
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         }
31 31
         // Set depending instabilities
32 32
         foreach ($packages as $eachPackage) {
33
-            $dependentInstabilities = array_map(function ($packageName) use ($instabilitiesByPackage) {
33
+            $dependentInstabilities = array_map(function($packageName) use ($instabilitiesByPackage) {
34 34
                 return isset($instabilitiesByPackage[$packageName]) ? $instabilitiesByPackage[$packageName] : null;
35 35
             }, $eachPackage->getOutgoingPackageDependencies());
36 36
 
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Component/File/Finder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $this->excludedDirs = $excludedDirs;
58 58
         $this->flags = $flags;
59 59
         if ($flags === -1) {
60
-            $this->flags = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO;
60
+            $this->flags = FilesystemIterator::KEY_AS_PATHNAME|FilesystemIterator::CURRENT_AS_FILEINFO;
61 61
         }
62 62
     }
63 63
 
@@ -72,15 +72,15 @@  discard block
 block discarded – undo
72 72
         $files = [];
73 73
         foreach ($paths as $path) {
74 74
             if (is_dir($path)) {
75
-                $path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
75
+                $path = rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
76 76
                 $directory = new RecursiveDirectoryIterator($path, $this->flags);
77 77
                 $iterator = new RecursiveIteratorIterator($directory);
78 78
 
79 79
                 $filterRegex = sprintf(
80 80
                     '`^%s%s%s$`',
81 81
                     preg_quote($path, '`'),
82
-                    !empty($this->excludedDirs) ? '((?!' . implode('|', array_map('preg_quote', $this->excludedDirs)) . ').)+' : '.+',
83
-                    '\.(' . implode('|', $this->extensions) . ')'
82
+                    !empty($this->excludedDirs) ? '((?!'.implode('|', array_map('preg_quote', $this->excludedDirs)).').)+' : '.+',
83
+                    '\.('.implode('|', $this->extensions).')'
84 84
                 );
85 85
 
86 86
                 $filteredIterator = new RegexIterator(
Please login to merge, or discard this patch.
phpmetrics/src/Hal/Component/Ast/Traverser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
     public function __construct(CustomNodeTraverser $traverser, $stopCondition = null)
32 32
     {
33 33
         if (null === $stopCondition) {
34
-            $stopCondition = function ($node) {
34
+            $stopCondition = function($node) {
35 35
                 if ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_) {
36 36
                     return false;
37 37
                 }
Please login to merge, or discard this patch.
phpmetrics/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.
phpmetrics/src/Hal/Component/Output/ProgressBar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
             return
99 99
                 0 >= version_compare(
100 100
                     '10.0.10586',
101
-                    PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD
101
+                    PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD
102 102
                 )
103 103
                 || false !== getenv('ANSICON')
104 104
                 || 'ON' === getenv('ConEmuANSI')
Please login to merge, or discard this patch.