Completed
Pull Request — master (#403)
by
unknown
03:04
created
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.
src/Hal/Metric/Class_/ClassEnumVisitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
                 $class->set('interface', true);
38 38
                 $class->set('abstract', true);
39 39
             } else {
40
-                $name = (string)(isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node));
40
+                $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node));
41 41
                 $class = new ClassMetric($name);
42 42
                 $class->set('interface', false);
43 43
                 $class->set('abstract', $node instanceof Stmt\Trait_ || $node->isAbstract());
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $roleDetector = new RoleOfMethodDetector();
51 51
             foreach ($node->stmts as $stmt) {
52 52
                 if ($stmt instanceof Stmt\ClassMethod) {
53
-                    $function = new FunctionMetric((string)$stmt->name);
53
+                    $function = new FunctionMetric((string) $stmt->name);
54 54
 
55 55
                     $role = $roleDetector->detects($stmt);
56 56
                     $function->set('role', $role);
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Text/HalsteadVisitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@  discard block
 block discarded – undo
44 44
     {
45 45
         if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_ || $node instanceof Stmt\Trait_) {
46 46
             if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Trait_) {
47
-                $name = (string)(isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node));
47
+                $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node));
48 48
                 $classOrFunction = $this->metrics->get($name);
49 49
             } else {
50
-                $classOrFunction = new FunctionMetric((string)$node->name);
50
+                $classOrFunction = new FunctionMetric((string) $node->name);
51 51
                 $this->metrics->attach($classOrFunction);
52 52
             }
53 53
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             $operands = [];
56 56
             $operators = [];
57 57
 
58
-            iterate_over_node($node, function ($node) use (&$operators, &$operands) {
58
+            iterate_over_node($node, function($node) use (&$operators, &$operands) {
59 59
                 if ($node instanceof Node\Expr\BinaryOp
60 60
                     || $node instanceof Node\Expr\AssignOp
61 61
                     || $node instanceof Stmt\If_
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Text/LengthVisitor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,10 +34,10 @@  discard block
 block discarded – undo
34 34
     {
35 35
         if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Function_ || $node instanceof Stmt\Trait_) {
36 36
             if ($node instanceof Stmt\Class_ || $node instanceof Stmt\Trait_) {
37
-                $name = (string)(isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node));
37
+                $name = (string) (isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node));
38 38
                 $classOrFunction = $this->metrics->get($name);
39 39
             } else {
40
-                $classOrFunction = new FunctionMetric((string)$node->name);
40
+                $classOrFunction = new FunctionMetric((string) $node->name);
41 41
                 $this->metrics->attach($classOrFunction);
42 42
             }
43 43
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             $code = preg_replace('!/\*.*?\*/!s', '', $code);
58 58
 
59 59
             // count and remove single line comments
60
-            $code = preg_replace_callback('!(\'[^\']*\'|"[^"]*")|((?:#|\/\/).*$)!m', function (array $matches) use (&$cloc) {
60
+            $code = preg_replace_callback('!(\'[^\']*\'|"[^"]*")|((?:#|\/\/).*$)!m', function(array $matches) use (&$cloc) {
61 61
                 if (isset($matches[2])) {
62 62
                     $cloc += 1;
63 63
                 }
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Structural/LcomVisitor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
             foreach ($node->stmts as $stmt) {
44 44
                 if ($stmt instanceof Stmt\ClassMethod) {
45
-                    if (!$graph->has($stmt->name . '()')) {
46
-                        $graph->insert(new TreeNode($stmt->name . '()'));
45
+                    if (!$graph->has($stmt->name.'()')) {
46
+                        $graph->insert(new TreeNode($stmt->name.'()'));
47 47
                     }
48
-                    $from = $graph->get($stmt->name . '()');
48
+                    $from = $graph->get($stmt->name.'()');
49 49
 
50
-                    \iterate_over_node($stmt, function ($node) use ($from, &$graph) {
50
+                    \iterate_over_node($stmt, function($node) use ($from, &$graph) {
51 51
                         if ($node instanceof Node\Expr\PropertyFetch && isset($node->var->name) && $node->var->name == 'this') {
52 52
                             $name = getNameOfNode($node);
53 53
                             // use of attribute $this->xxx;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                             if (!$node->var instanceof Node\Expr\New_ && isset($node->var->name) && getNameOfNode($node->var) === 'this') {
64 64
                                 // use of method call $this->xxx();
65 65
                                 // use of attribute $this->xxx;
66
-                                $name = getNameOfNode($node->name) . '()';
66
+                                $name = getNameOfNode($node->name).'()';
67 67
                                 if (!$graph->has($name)) {
68 68
                                     $graph->insert(new TreeNode($name));
69 69
                                 }
Please login to merge, or discard this patch.
src/Hal/Metric/Package/PackageCollectingVisitor.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
     public function enterNode(Node $node)
28 28
     {
29 29
         if ($node instanceof Namespace_) {
30
-            $this->namespace = (string)$node->name;
30
+            $this->namespace = (string) $node->name;
31 31
         }
32 32
     }
33 33
 
@@ -42,17 +42,17 @@  discard block
 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
             }
53 53
             /* @var PackageMetric $packageMetric */
54
-            $elementName = isset($node->namespacedName) ? $node->namespacedName : 'anonymous@' . spl_object_hash($node);
55
-            $elementName = (string)$elementName;
54
+            $elementName = isset($node->namespacedName) ? $node->namespacedName : 'anonymous@'.spl_object_hash($node);
55
+            $elementName = (string) $elementName;
56 56
             $packageMetric->addClass($elementName);
57 57
 
58 58
             $this->metrics->get($elementName)->set('package', $packageName);
Please login to merge, or discard this patch.