Completed
Pull Request — master (#264)
by Walt
02:13
created
src/Hal/Component/Issue/Issuer.php 1 patch
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
     }
131 131
 
132 132
     /**
133
-     * @param $status
133
+     * @param integer $status
134 134
      */
135 135
     protected function terminate($status)
136 136
     {
@@ -139,6 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
     /**
141 141
      * @param $log
142
+     * @param string $logfile
142 143
      * @return $this
143 144
      */
144 145
     protected function log($logfile, $log)
@@ -152,7 +153,7 @@  discard block
 block discarded – undo
152 153
     }
153 154
 
154 155
     /**
155
-     * @param $debugKey
156
+     * @param string $debugKey
156 157
      * @param $value
157 158
      * @return $this
158 159
      */
@@ -163,7 +164,7 @@  discard block
 block discarded – undo
163 164
     }
164 165
 
165 166
     /**
166
-     * @param $debugKey
167
+     * @param string $debugKey
167 168
      * @return $this
168 169
      */
169 170
     public function clear($debugKey)
Please login to merge, or discard this patch.
src/Hal/Metric/BagTrait.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
     }
50 50
 
51 51
     /**
52
-     * @param $key
52
+     * @param string $key
53 53
      * @return null
54 54
      */
55 55
     public function get($key)
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/ClassEnumVisitor.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Hal\Metric\Class_;
3 3
 
4
-use Hal\Component\Reflected\Method;
5 4
 use Hal\Metric\ClassMetric;
6 5
 use Hal\Metric\FunctionMetric;
7 6
 use Hal\Metric\Helper\RoleOfMethodDetector;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 block discarded – undo
82 82
             }
83 83
 
84 84
             $class->set('methods', $methods);
85
-            $class->set('nbMethodsIncludingGettersSetters', sizeof($methods) );
85
+            $class->set('nbMethodsIncludingGettersSetters', sizeof($methods));
86 86
             $class->set('nbMethods', sizeof($methods) - ($nbGetters + $nbSetters));
87 87
             $class->set('nbMethodsPrivate', $methodsPrivate);
88 88
             $class->set('nbMethodsPublic', $methodsPublic);
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Complexity/CyclomaticComplexityVisitor.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 namespace Hal\Metric\Class_\Complexity;
3 3
 
4
-use Hal\Component\Reflected\Method;
5 4
 use Hal\Metric\Metrics;
6 5
 use PhpParser\Node;
7 6
 use PhpParser\Node\Stmt;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 if ($stmt instanceof Stmt\ClassMethod) {
56 56
 
57 57
                     // iterate over childs, recursively
58
-                    $cb = function ($node) use (&$cb) {
58
+                    $cb = function($node) use (&$cb) {
59 59
                         $ccn = 0;
60 60
                         if (isset($node->stmts) && $node->stmts) {
61 61
                             foreach ($node->stmts as $child) {
Please login to merge, or discard this patch.
src/Hal/Metric/Class_/Component/MaintainabilityIndexVisitor.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Hal\Metric\FunctionMetric;
5 5
 use Hal\Metric\Metrics;
6
-use Hoa\Ruler\Model\Bag\Scalar;
7 6
 use PhpParser\Node;
8 7
 use PhpParser\Node\Stmt;
9 8
 use PhpParser\NodeVisitorAbstract;
Please login to merge, or discard this patch.
src/Hal/Report/Html/Reporter.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@
 block discarded – undo
109 109
     }
110 110
 
111 111
     /**
112
-     * @param $source
113
-     * @param $destination
112
+     * @param string $source
113
+     * @param string $destination
114 114
      * @return $this
115 115
      */
116 116
     public function renderPage($source, $destination, Consolidated $consolidated, $history)
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Hal\Application\Config\Config;
5 5
 use Hal\Metric\Consolidated;
6
-use Hal\Metric\Consolided;
7 6
 use Hal\Metric\Metrics;
8 7
 use Symfony\Component\Console\Output\OutputInterface;
9 8
 
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
             sprintf('%s/js/history-%d.json', $logDir, $next),
93 93
             json_encode($today, JSON_PRETTY_PRINT)
94 94
         );
95
-	file_put_contents(
95
+    file_put_contents(
96 96
             sprintf('%s/js/latest.json', $logDir, $next),
97 97
             json_encode($today, JSON_PRETTY_PRINT)
98 98
         );
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
         $consolidated = new Consolidated($metrics);
45 45
 
46 46
         // history of builds
47
-        $today = (object)[
47
+        $today = (object) [
48 48
             'avg' => $consolidated->getAvg(),
49 49
             'sum' => $consolidated->getSum()
50 50
         ];
51
-        $files = glob($logDir . '/js/history-*.json');
51
+        $files = glob($logDir.'/js/history-*.json');
52 52
         $next = sizeof($files) + 1;
53 53
         $history = [];
54 54
         natsort($files);
@@ -57,34 +57,34 @@  discard block
 block discarded – undo
57 57
         }
58 58
 
59 59
         // copy sources
60
-        if(!file_exists($logDir . '/js')) {
60
+        if (!file_exists($logDir.'/js')) {
61 61
             mkdir($logDir.'/js', 0755, true);
62 62
         }
63
-        if(!file_exists($logDir . '/css')) {
63
+        if (!file_exists($logDir.'/css')) {
64 64
             mkdir($logDir.'/css', 0755, true);
65 65
         }
66
-        if(!file_exists($logDir . '/images')) {
66
+        if (!file_exists($logDir.'/images')) {
67 67
             mkdir($logDir.'/images', 0755, true);
68 68
         }
69
-        recurse_copy(__DIR__ . '/template/js', $logDir . '/js');
70
-        recurse_copy(__DIR__ . '/template/css', $logDir . '/css');
71
-        recurse_copy(__DIR__ . '/template/images', $logDir . '/images');
69
+        recurse_copy(__DIR__.'/template/js', $logDir.'/js');
70
+        recurse_copy(__DIR__.'/template/css', $logDir.'/css');
71
+        recurse_copy(__DIR__.'/template/images', $logDir.'/images');
72 72
 
73 73
         // render dynamic pages
74
-        $this->renderPage(__DIR__ . '/template/index.php', $logDir . '/index.html', $consolidated, $history);
75
-        $this->renderPage(__DIR__ . '/template/loc.php', $logDir . '/loc.html', $consolidated, $history);
76
-        $this->renderPage(__DIR__ . '/template/relations.php', $logDir . '/relations.html', $consolidated, $history);
77
-        $this->renderPage(__DIR__ . '/template/coupling.php', $logDir . '/coupling.html', $consolidated, $history);
78
-        $this->renderPage(__DIR__ . '/template/all.php', $logDir . '/all.html', $consolidated, $history);
79
-        $this->renderPage(__DIR__ . '/template/oop.php', $logDir . '/oop.html', $consolidated, $history);
80
-        $this->renderPage(__DIR__ . '/template/complexity.php', $logDir . '/complexity.html', $consolidated, $history);
81
-        $this->renderPage(__DIR__ . '/template/panel.php', $logDir . '/panel.html', $consolidated, $history);
82
-        $this->renderPage(__DIR__ . '/template/violations.php', $logDir . '/violations.html', $consolidated, $history);
74
+        $this->renderPage(__DIR__.'/template/index.php', $logDir.'/index.html', $consolidated, $history);
75
+        $this->renderPage(__DIR__.'/template/loc.php', $logDir.'/loc.html', $consolidated, $history);
76
+        $this->renderPage(__DIR__.'/template/relations.php', $logDir.'/relations.html', $consolidated, $history);
77
+        $this->renderPage(__DIR__.'/template/coupling.php', $logDir.'/coupling.html', $consolidated, $history);
78
+        $this->renderPage(__DIR__.'/template/all.php', $logDir.'/all.html', $consolidated, $history);
79
+        $this->renderPage(__DIR__.'/template/oop.php', $logDir.'/oop.html', $consolidated, $history);
80
+        $this->renderPage(__DIR__.'/template/complexity.php', $logDir.'/complexity.html', $consolidated, $history);
81
+        $this->renderPage(__DIR__.'/template/panel.php', $logDir.'/panel.html', $consolidated, $history);
82
+        $this->renderPage(__DIR__.'/template/violations.php', $logDir.'/violations.html', $consolidated, $history);
83 83
         if ($this->config->has('git')) {
84
-            $this->renderPage(__DIR__ . '/template/git.php', $logDir . '/git.html', $consolidated, $history);
84
+            $this->renderPage(__DIR__.'/template/git.php', $logDir.'/git.html', $consolidated, $history);
85 85
         }
86 86
         if ($this->config->has('junit')) {
87
-            $this->renderPage(__DIR__ . '/template/junit.php', $logDir . '/junit.html', $consolidated, $history);
87
+            $this->renderPage(__DIR__.'/template/junit.php', $logDir.'/junit.html', $consolidated, $history);
88 88
         }
89 89
 
90 90
         // js data
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 
100 100
         // json data
101 101
         file_put_contents(
102
-            $logDir . '/js/classes.js',
103
-            'var classes = ' . json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
102
+            $logDir.'/js/classes.js',
103
+            'var classes = '.json_encode($consolidated->getClasses(), JSON_PRETTY_PRINT)
104 104
         );
105 105
 
106 106
         $this->output->writeln(sprintf('HTML report generated in "%s" directory', $logDir),
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
 
170 170
         $diff = $newValue - $oldValue;
171 171
         if ($diff > 0) {
172
-            $diff = '+' . $diff;
172
+            $diff = '+'.$diff;
173 173
         }
174 174
 
175 175
         $goodOrBad = 'neutral';
Please login to merge, or discard this patch.
src/Hal/Report/Violations/Xml/Reporter.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 namespace Hal\Report\Violations\Xml;
3 3
 
4 4
 use Hal\Application\Config\Config;
5
-use Hal\Metric\Consolided;
6 5
 use Hal\Metric\Metrics;
7 6
 use Hal\Violation\Violation;
8 7
 use Symfony\Component\Console\Output\OutputInterface;
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     }
91 91
 
92 92
     if ($node instanceof \PhpParser\Node\Name\FullyQualified) {
93
-        return (string)$node;
93
+        return (string) $node;
94 94
     }
95 95
     if ($node instanceof \PhpParser\Node\Expr\New_) {
96 96
         return getNameOfNode($node->class);
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     }
102 102
 
103 103
     if ($node instanceof \PhpParser\Node\Name) {
104
-        return (string)implode($node->parts);
104
+        return (string) implode($node->parts);
105 105
     }
106 106
 
107 107
     if (isset($node->name) && $node->name instanceof \PhpParser\Node\Expr\Variable) {
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     }
130 130
 
131 131
     if (isset($node->name)) {
132
-        return (string)$node->name;
132
+        return (string) $node->name;
133 133
     }
134 134
 
135 135
     return null;
@@ -147,10 +147,10 @@  discard block
 block discarded – undo
147 147
     }
148 148
     while (false !== ($file = readdir($dir))) {
149 149
         if (($file != '.') && ($file != '..')) {
150
-            if (is_dir($src . '/' . $file)) {
151
-                recurse_copy($src . '/' . $file, $dst . '/' . $file);
150
+            if (is_dir($src.'/'.$file)) {
151
+                recurse_copy($src.'/'.$file, $dst.'/'.$file);
152 152
             } else {
153
-                copy($src . '/' . $file, $dst . '/' . $file);
153
+                copy($src.'/'.$file, $dst.'/'.$file);
154 154
             }
155 155
         }
156 156
     }
Please login to merge, or discard this patch.
src/Hal/Violation/Violations.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
     {
45 45
         $string = '';
46 46
         foreach ($this->data as $violation) {
47
-            $string .= $violation->getName() . ',';
47
+            $string .= $violation->getName().',';
48 48
         }
49 49
         return $string;
50 50
     }
Please login to merge, or discard this patch.