Completed
Pull Request — master (#341)
by Gabriel
02:29
created
artifacts/phar/build.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2
-chdir(__DIR__ . '/../../');
2
+chdir(__DIR__.'/../../');
3 3
 
4 4
 if (!file_exists('vendor/autoload.php')) {
5
-    echo '[ERROR] It\'s required to run "composer install" before building PhpMetrics!' . PHP_EOL;
5
+    echo '[ERROR] It\'s required to run "composer install" before building PhpMetrics!'.PHP_EOL;
6 6
     exit(1);
7 7
 }
8 8
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     if (preg_match($exclude, $file)) {
22 22
         continue;
23 23
     }
24
-    $path = str_replace(__DIR__ . '/', '', $file);
24
+    $path = str_replace(__DIR__.'/', '', $file);
25 25
     $phar->addFromString($path, file_get_contents($file));
26 26
 }
27 27
 
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 
53 53
 function rglob($pattern = '*', $flags = 0, $path = '')
54 54
 {
55
-    $paths = glob($path . '*', GLOB_MARK | GLOB_ONLYDIR | GLOB_NOSORT);
56
-    $files = glob($path . $pattern, $flags);
55
+    $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);
56
+    $files = glob($path.$pattern, $flags);
57 57
     foreach ($paths as $path) {
58 58
         $files = array_merge($files, rglob($pattern, $flags, $path));
59 59
     }
Please login to merge, or discard this patch.
src/Hal/Component/Ast/NodeTraverser.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -21,6 +21,9 @@
 block discarded – undo
21 21
 {
22 22
     protected $stopCondition;
23 23
 
24
+    /**
25
+     * @param \Closure $stopCondition
26
+     */
24 27
     public function __construct($cloneNodes = false, $stopCondition = null)
25 28
     {
26 29
         parent::__construct($cloneNodes);
Please login to merge, or discard this 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
         parent::__construct($cloneNodes);
27 27
 
28
-        if(null === $stopCondition) {
28
+        if (null === $stopCondition) {
29 29
             $stopCondition = function($node) {
30 30
                 return !$node instanceof Node\Stmt\Class_ && !$node instanceof Node\Stmt\Interface_;
31 31
             };
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
@@ -58,13 +58,13 @@  discard block
 block discarded – undo
58 58
         }
59 59
 
60 60
         // sums
61
-        $sum = (object)[
61
+        $sum = (object) [
62 62
             'loc' => 0,
63 63
             'cloc' => 0,
64 64
             'lloc' => 0,
65 65
             'nbMethods' => 0,
66 66
         ];
67
-        $avg = (object)[
67
+        $avg = (object) [
68 68
             'ccn' => [],
69 69
             'bugs' => [],
70 70
             'kanDefect' => [],
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                 $violations[$name]++;
125 125
             }
126 126
         }
127
-        $sum->violations = (object)$violations;
127
+        $sum->violations = (object) $violations;
128 128
 
129 129
 
130 130
         $this->avg = $avg;
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
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
                 if ($stmt instanceof Stmt\ClassMethod) {
56 56
 
57 57
                     // iterate over children, 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/Report/Html/template/loc.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php require __DIR__ . '/_header.php'; ?>
1
+<?php require __DIR__.'/_header.php'; ?>
2 2
 
3 3
 
4 4
 <?php
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
 
20 20
 // 2. percentile map
21 21
 $json = [];
22
-if(sizeof($array) > 1) {
22
+if (sizeof($array) > 1) {
23 23
     $range = range(0.5, 1, .05);
24 24
     foreach ($range as $percentile) {
25
-        $json[] = (object)[
25
+        $json[] = (object) [
26 26
             'lloc' => procentile($array, $percentile),
27 27
             'percentile' => $percentile * 100,
28 28
         ];
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 </div>
75 75
 
76 76
 
77
-<?php require __DIR__ . '/_footer.php'; ?>
77
+<?php require __DIR__.'/_footer.php'; ?>
78 78
 
79 79
 
80 80
 <script>
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
@@ -3,7 +3,6 @@
 block discarded – undo
3 3
 
4 4
 use Hal\Application\Config\Config;
5 5
 use Hal\Component\Output\Output;
6
-use Hal\Metric\Consolided;
7 6
 use Hal\Metric\Metrics;
8 7
 use Hal\Violation\Violation;
9 8
 
Please login to merge, or discard this patch.
src/Hal/Component/Output/ProgressBar.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@
 block discarded – undo
18 18
      * @package Hal\Component\Issue
19 19
      */
20 20
 /**
21
- * Class ProgressBar
22
- * @package Hal\Component\Output
23
- */
21
+     * Class ProgressBar
22
+     * @package Hal\Component\Output
23
+     */
24 24
 class ProgressBar
25 25
 {
26 26
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@
 block discarded – undo
97 97
         if (DIRECTORY_SEPARATOR === '\\') {
98 98
             return
99 99
                 0 >= version_compare('10.0.10586',
100
-                    PHP_WINDOWS_VERSION_MAJOR . '.' . PHP_WINDOWS_VERSION_MINOR . '.' . PHP_WINDOWS_VERSION_BUILD)
100
+                    PHP_WINDOWS_VERSION_MAJOR.'.'.PHP_WINDOWS_VERSION_MINOR.'.'.PHP_WINDOWS_VERSION_BUILD)
101 101
                 || false !== getenv('ANSICON')
102 102
                 || 'ON' === getenv('ConEmuANSI')
103 103
                 || 'xterm' === getenv('TERM');
Please login to merge, or discard this patch.
src/Hal/Component/Output/TestOutput.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
      */
24 24
     public function writeln($message)
25 25
     {
26
-        $this->write(PHP_EOL . $message);
26
+        $this->write(PHP_EOL.$message);
27 27
         return $this;
28 28
     }
29 29
 
Please login to merge, or discard this patch.
src/Hal/Component/Output/CliOutput.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      */
26 26
     public function writeln($message)
27 27
     {
28
-        $this->write(PHP_EOL . $message);
28
+        $this->write(PHP_EOL.$message);
29 29
         return $this;
30 30
     }
31 31
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function write($message)
36 36
     {
37
-        $this->quietMode||file_put_contents('php://stdout', $message);
37
+        $this->quietMode || file_put_contents('php://stdout', $message);
38 38
         return $this;
39 39
     }
40 40
 
Please login to merge, or discard this patch.