Completed
Push — master ( 1dd4d3...dc6d85 )
by personal
01:37
created
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/Class_/Coupling/ExternalsVisitor.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -136,6 +136,9 @@
 block discarded – undo
136 136
         }
137 137
     }
138 138
 
139
+    /**
140
+     * @param string|null $dependency
141
+     */
139 142
     private function pushToDependencies(array &$dependencies, $dependency)
140 143
     {
141 144
         $lowercase = strtolower($dependency);
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -58,20 +58,20 @@  discard block
 block discarded – undo
58 58
             // extends
59 59
             if (isset($node->extends)) {
60 60
                 if (is_array($node->extends)) {
61
-                    foreach ((array)$node->extends as $interface) {
62
-                        $this->pushToDependencies($dependencies, (string)$interface);
63
-                        array_push($parents, (string)$interface);
61
+                    foreach ((array) $node->extends as $interface) {
62
+                        $this->pushToDependencies($dependencies, (string) $interface);
63
+                        array_push($parents, (string) $interface);
64 64
                     }
65 65
                 } else {
66
-                    $this->pushToDependencies($dependencies, (string)$node->extends);
67
-                    array_push($parents, (string)$node->extends);
66
+                    $this->pushToDependencies($dependencies, (string) $node->extends);
67
+                    array_push($parents, (string) $node->extends);
68 68
                 }
69 69
             }
70 70
 
71 71
             // implements
72 72
             if (isset($node->implements)) {
73 73
                 foreach ($node->implements as $interface) {
74
-                    $this->pushToDependencies($dependencies, (string)$interface);
74
+                    $this->pushToDependencies($dependencies, (string) $interface);
75 75
                 }
76 76
             }
77 77
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
                     // return
81 81
                     if (isset($stmt->returnType)) {
82 82
                         if ($stmt->returnType instanceof Node\Name\FullyQualified) {
83
-                            $this->pushToDependencies($dependencies, (string)$stmt->returnType);
83
+                            $this->pushToDependencies($dependencies, (string) $stmt->returnType);
84 84
                         }
85 85
                     }
86 86
 
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
                     foreach ($stmt->params as $param) {
89 89
                         if ($param->type) {
90 90
                             if ($param->type instanceof Node\Name\FullyQualified) {
91
-                                $this->pushToDependencies($dependencies, (string)$param->type);
91
+                                $this->pushToDependencies($dependencies, (string) $param->type);
92 92
                             }
93 93
                         }
94 94
                     }
95 95
 
96 96
                     // instantiations, static calls
97
-                    \iterate_over_node($stmt, function ($node) use (&$dependencies) {
97
+                    \iterate_over_node($stmt, function($node) use (&$dependencies) {
98 98
                         switch (true) {
99 99
                             case $node instanceof Node\Expr\New_:
100 100
                                 // new MyClass
@@ -113,13 +113,13 @@  discard block
 block discarded – undo
113 113
                         foreach ($matches[1] as $check) {
114 114
                             foreach ($this->uses as $use) {
115 115
                                 if (method_exists($use, 'getAlias')) {
116
-                                    if (((string)$use->getAlias()) === $check) {
117
-                                        $this->pushToDependencies($dependencies, (string)($use->name));
116
+                                    if (((string) $use->getAlias()) === $check) {
117
+                                        $this->pushToDependencies($dependencies, (string) ($use->name));
118 118
                                     }
119 119
                                     continue;
120 120
                                 }
121 121
                                 if ($use->alias === $check) {
122
-                                    $this->pushToDependencies($dependencies, (string)($use->name));
122
+                                    $this->pushToDependencies($dependencies, (string) ($use->name));
123 123
                                 }
124 124
                             }
125 125
                         }
@@ -138,6 +138,6 @@  discard block
 block discarded – undo
138 138
         if ('self' === $lowercase || 'parent' === $lowercase) {
139 139
             return;
140 140
         }
141
-        array_push($dependencies, (string)$dependency);
141
+        array_push($dependencies, (string) $dependency);
142 142
     }
143 143
 }
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.
src/Hal/Metric/Class_/Complexity/CyclomaticComplexityVisitor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             foreach ($node->stmts as $stmt) {
65 65
                 if ($stmt instanceof Stmt\ClassMethod) {
66 66
                     // iterate over children, recursively
67
-                    $cb = function ($node) use (&$cb) {
67
+                    $cb = function($node) use (&$cb) {
68 68
                         $ccn = 0;
69 69
 
70 70
                         foreach (get_object_vars($node) as $name => $member) {
Please login to merge, or discard this patch.
src/Hal/Application/Application.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
         $output = new CliOutput();
23 23
 
24 24
         // issues and debug
25
-        $issuer = (new Issuer($output));//->enable();
25
+        $issuer = (new Issuer($output)); //->enable();
26 26
 
27 27
         // config
28 28
         $config = (new Parser())->parse($argv);
Please login to merge, or discard this patch.
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.
src/Hal/Component/Ast/Traverser.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
     public function __construct(Mother $traverser, $stopCondition = null)
28 28
     {
29 29
         if (null === $stopCondition) {
30
-            $stopCondition = function ($node) {
30
+            $stopCondition = function($node) {
31 31
                 if ($node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_) {
32 32
                     return false;
33 33
                 }
Please login to merge, or discard this patch.
src/Hal/Metric/Consolidated.php 1 patch
Spacing   +3 added lines, -3 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' => [],
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 $violations[$name]++;
165 165
             }
166 166
         }
167
-        $sum->violations = (object)$violations;
167
+        $sum->violations = (object) $violations;
168 168
 
169 169
         $this->avg = $avg;
170 170
         $this->sum = $sum;
Please login to merge, or discard this patch.